Commit 8b4cb4e2 authored by earndt's avatar earndt

[AFP-108] 👷 Makes changes to Dockerfile for Azure deployment [@earndt]

parent 68388055
FROM node:13.12.0-alpine as build FROM node:14.16-alpine3.13 as build
WORKDIR /app WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./ COPY . .
COPY package-lock.json ./ RUN yarn
RUN npm ci RUN yarn build
RUN npm install react-scripts@3.4.1 -g
COPY . ./
RUN npm run build
FROM nginx:stable-alpine FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html COPY --from=build /app/build /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
####BELOW IS FOR TESTING ONLY, DO NOT UNCOMMENT
#FROM node:13.12.0-alpine as build
#WORKDIR /app
#ENV PATH /app/node_modules/.bin:$PATH
#COPY package.json ./
#COPY package-lock.json ./
#RUN npm ci
#RUN npm install react-scripts@3.4.1 -g
#COPY . ./
#RUN npm run build
#FROM nginx:stable-alpine
#COPY --from=build /app/build /usr/share/nginx/html
#COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
#EXPOSE 80
#CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
server { server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}
listen 80; # server {
#
# listen 80;
location / { # location / {
root /usr/share/nginx/html; # root /usr/share/nginx/html;
index index.html index.htm; # index index.html index.htm;
try_files $uri $uri/ /index.html; # try_files $uri $uri/ /index.html;
} # }
error_page 500 502 503 504 /50x.html; # error_page 500 502 503 504 /50x.html;
location = /50x.html { # location = /50x.html {
root /usr/share/nginx/html; # root /usr/share/nginx/html;
} # }
} # }
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment