Force 404 on static folder when a file is not found (#1165)
This commit is contained in:
@ -13,6 +13,8 @@ COPY ./front .
|
|||||||
RUN yarn install
|
RUN yarn install
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
|
COPY ./infra/prod/front/serve.json ./build
|
||||||
|
|
||||||
FROM node:18.16.0-alpine as front
|
FROM node:18.16.0-alpine as front
|
||||||
|
|
||||||
WORKDIR /app/front
|
WORKDIR /app/front
|
||||||
@ -20,4 +22,4 @@ COPY --from=build /app/front/build ./build
|
|||||||
|
|
||||||
RUN yarn global add serve
|
RUN yarn global add serve
|
||||||
|
|
||||||
CMD ["serve", "-s", "build"]
|
CMD ["serve", "build"]
|
||||||
|
|||||||
6
infra/prod/front/serve.json
Normal file
6
infra/prod/front/serve.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"rewrites": [
|
||||||
|
{ "source": "!static/**", "destination": "/index.html" }
|
||||||
|
],
|
||||||
|
"directoryListing": false
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user