28 lines
464 B
Docker
28 lines
464 B
Docker
# build environment
|
|
FROM node:12 as builder
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
COPY . ./
|
|
#RUN ls
|
|
RUN npm run build
|
|
|
|
# production environment
|
|
FROM node:12
|
|
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 /
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["sh", "-c", "serve -s application -p 80"]
|