network-resurrector-frontend/dockerfile

28 lines
516 B
Plaintext
Raw Normal View History

2020-12-26 02:27:53 +02:00
# build environment
2020-12-27 00:05:21 +02:00
FROM node:12-slim as builder
2020-12-26 02:27:53 +02:00
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . ./
RUN npm run build
# production environment
2020-12-27 00:05:21 +02:00
FROM node:12-slim
2020-12-26 02:27:53 +02:00
RUN printf '\n\n- Copy application files\n'
ARG APP_SUBFOLDER=network-resurrector
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"]