build for prod

This commit is contained in:
Collin M. Barrett 2019-07-27 08:56:52 -05:00
parent ac0e6c097b
commit e284bf35ef
3 changed files with 16 additions and 6 deletions

View file

@ -16,7 +16,7 @@ server {
}
location / {
proxy_pass http://web:3000;
proxy_pass http://web:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;

View file

@ -20,7 +20,7 @@ server {
}
location / {
proxy_pass http://web:3000;
proxy_pass http://web:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;

View file

@ -2,14 +2,24 @@
# Command: docker build -f src/FilterLists.Web/Dockerfile .
# init base
FROM node:alpine as final
CMD ["npm", "start"]
FROM node:alpine as base
EXPOSE 3000
WORKDIR /usr/app/
ENTRYPOINT ["serve", "-s"]
RUN npm install -g serve
# init build
FROM node:alpine as build
# install
COPY src/web/package*.json ./
WORKDIR /usr/src/app/
COPY src/FilterLists.Web/package*.json ./
RUN npm install --only=prod
# build
COPY src/FilterLists.Web/. ./
RUN npm run build
# final
COPY src/web/. ./
FROM base as final
COPY --from=build /usr/src/app/build ./