From 8e9e5e1b0168b35b50444d345fb264e0ef37c9f1 Mon Sep 17 00:00:00 2001 From: DTieman Date: Tue, 21 Mar 2023 17:21:37 +0100 Subject: [PATCH] bye nginx --- Dockerfile | 17 ++++++----------- nginx/nginx.conf | 21 --------------------- 2 files changed, 6 insertions(+), 32 deletions(-) delete mode 100644 nginx/nginx.conf diff --git a/Dockerfile b/Dockerfile index cf56234..86a0913 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,10 @@ # Create a production build of the app FROM node:16.9.1 as build -WORKDIR /app -ENV PATH /app/node_modules/.bin:$PATH -COPY package.json ./ -RUN npm install COPY . . -RUN npm run build +RUN npm install --silent -FROM nginx:stable -COPY --from=build /app/build /usr/share/nginx/html -RUN rm /etc/nginx/conf.d/default.conf -COPY nginx/nginx.conf /etc/nginx/conf.d -EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +RUN npm run build +RUN npm install -g serve + +EXPOSE 3000 +CMD serve -l 3000 -s build \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index 60ee47c..0000000 --- a/nginx/nginx.conf +++ /dev/null @@ -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; - } - -} \ No newline at end of file