2020-04-18 12:19:25 +03:00
|
|
|
# build environment
|
|
|
|
FROM node:12 as builder
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY package*.json ./
|
|
|
|
RUN npm install
|
|
|
|
|
|
|
|
COPY . ./
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
# production environment
|
|
|
|
FROM node:12
|
|
|
|
|
2020-05-01 04:47:16 +03:00
|
|
|
RUN printf '\n\n- Copy application files\n'
|
2020-05-01 05:02:23 +03:00
|
|
|
|
|
|
|
ARG APP_SUBFOLDER=play-nine
|
|
|
|
|
|
|
|
COPY --from=builder /app/build ./application/${APP_SUBFOLDER}
|
2020-05-01 04:47:16 +03:00
|
|
|
COPY --from=builder /app/build/index.html ./application/
|
|
|
|
|
|
|
|
RUN npm install -g serve@11.3.0
|
2020-04-18 12:19:25 +03:00
|
|
|
EXPOSE 80
|
2020-05-01 04:47:16 +03:00
|
|
|
CMD ["sh","-c","serve -s application -p 80"]
|