reverse-proxy-frontend/Dockerfile

28 lines
474 B
Docker
Raw Normal View History

2020-04-14 10:53:19 +03:00
# build environment
2022-07-16 11:07:31 +03:00
FROM node:16-slim as builder
2020-04-14 10:53:19 +03:00
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . ./
2020-05-27 01:31:31 +03:00
#RUN ls
2020-04-14 10:53:19 +03:00
RUN npm run build
# production environment
2022-06-25 01:40:12 +03:00
FROM node:12-slim
2020-05-26 23:58:00 +03:00
ARG APP_SUBFOLDER=reverse-proxy
COPY --from=builder /app/build ./application/${APP_SUBFOLDER}
COPY --from=builder /app/build/index.html ./application/
#install static server
RUN npm install -g serve
#set workdir to root
WORKDIR /
2020-05-27 01:31:31 +03:00
2020-04-14 10:53:19 +03:00
EXPOSE 80
2020-05-26 23:58:00 +03:00
2020-05-27 01:31:31 +03:00
CMD ["sh", "-c", "serve -s application -p 80"]