reverse-proxy-frontend/Dockerfile

36 lines
621 B
Docker
Raw Normal View History

2020-04-14 10:53:19 +03:00
# build environment
2022-07-16 12:11:08 +03:00
FROM node:14-slim as builder
2020-04-14 10:53:19 +03:00
WORKDIR /app
ARG OWN_NPM_TOKEN
COPY .npmrc .npmrc
2020-04-14 10:53:19 +03:00
COPY package*.json ./
RUN npm install
RUN rm -f .npmrc
2020-04-14 10:53:19 +03:00
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-07-16 12:11:08 +03:00
FROM node:14-slim
ARG APP_SUBFOLDER=""
2020-05-26 23:58:00 +03:00
COPY --from=builder /app/build ./application${APP_SUBFOLDER}
2020-05-26 23:58:00 +03:00
COPY --from=builder /app/build/index.html ./application/
#install static server
RUN npm install -g serve
2022-07-18 08:49:59 +03:00
# environment variables
ENV Author="Tudor Stanciu"
2022-09-24 02:57:49 +03:00
ARG APP_VERSION=0.0.0
2022-07-18 08:49:59 +03:00
ENV APP_VERSION=${APP_VERSION}
2020-05-26 23:58:00 +03:00
#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"]