2020-11-16 19:28:10 +00:00
|
|
|
FROM node:12-alpine AS builder
|
|
|
|
|
|
|
|
WORKDIR /home/node/app
|
|
|
|
|
|
|
|
COPY ./web/package.json .
|
|
|
|
RUN npm install
|
2020-11-17 02:22:28 +00:00
|
|
|
|
2020-11-16 19:28:10 +00:00
|
|
|
COPY ./web .
|
2020-11-17 02:22:28 +00:00
|
|
|
|
|
|
|
# modify index.html template to allow injection of js variables at runtime
|
|
|
|
RUN sed -i '/<\/head>/i <script src="\/env-config.js"><\/script>' src/index.template.html
|
2020-11-16 19:28:10 +00:00
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
FROM nginx:stable
|
|
|
|
|
2020-11-17 02:22:28 +00:00
|
|
|
ENV PUBLIC_DIR /usr/share/nginx/html
|
|
|
|
|
|
|
|
COPY --from=builder /home/node/app/dist/ ${PUBLIC_DIR}
|
|
|
|
|
2020-11-19 03:42:45 +00:00
|
|
|
COPY docker/containers/tactical-frontend/entrypoint.sh /docker-entrypoint.d/
|
|
|
|
RUN chmod +x /docker-entrypoint.d/entrypoint.sh
|