2020-02-12 16:18:43 +00:00
|
|
|
FROM node:12-alpine AS builder
|
|
|
|
ARG APP_HOST
|
|
|
|
ARG API_HOST
|
|
|
|
EXPOSE 80
|
|
|
|
WORKDIR /home/node
|
|
|
|
RUN apk add gettext
|
|
|
|
COPY ./web .
|
2020-02-16 05:30:41 +00:00
|
|
|
COPY ./docker/app/.env.local.keep /home/.env.local.tmp
|
2020-02-19 00:33:01 +00:00
|
|
|
RUN envsubst '\$API_HOST' < /home/.env.local.tmp > /home/node/.env.local && rm /home/.env.local.tmp
|
2020-02-12 16:18:43 +00:00
|
|
|
RUN npm install && npm run build
|
|
|
|
COPY ./docker/app/app.conf /home/node/app.conf.tmp
|
|
|
|
RUN envsubst '\$APP_HOST' < /home/node/app.conf.tmp > /home/node/app.conf
|
|
|
|
|
|
|
|
FROM nginx:alpine
|
|
|
|
WORKDIR /usr/share/nginx/html
|
|
|
|
COPY --from=builder /home/node/dist .
|
|
|
|
COPY --from=builder /home/node/app.conf /etc/nginx/conf.d/default.conf
|