bye nginx

This commit is contained in:
2023-03-21 17:21:37 +01:00
parent 23f939c16a
commit 8e9e5e1b01
2 changed files with 6 additions and 32 deletions

View File

@@ -1,15 +1,10 @@
# Create a production build of the app # Create a production build of the app
FROM node:16.9.1 as build FROM node:16.9.1 as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
RUN npm install
COPY . . COPY . .
RUN npm run build RUN npm install --silent
FROM nginx:stable RUN npm run build
COPY --from=build /app/build /usr/share/nginx/html RUN npm install -g serve
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d EXPOSE 3000
EXPOSE 80 CMD serve -l 3000 -s build
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -1,21 +0,0 @@
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
# to redirect all the requests to index.html,
# useful when you are using react-router
try_files $uri /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}