srumboard_frontend/Dockerfile

23 lines
631 B
Docker
Raw Permalink Normal View History

2020-06-02 13:38:54 +00:00
# Stage 1: Build
FROM node:alpine AS build
WORKDIR /build
2020-07-08 12:00:07 +00:00
## Install git (test)
RUN apk add --no-cache git
2020-06-02 13:38:54 +00:00
## Install app dependencies
COPY package*.json ./
2020-07-08 11:53:57 +00:00
RUN npm install --unsafe-perm
2020-06-02 13:38:54 +00:00
## Bundle app source
COPY . .
## Compile App
RUN npm run build
# Stage 2: Package up with the webserver
FROM nginx:alpine AS final
ENV API_URL "http://localhost:5001"
2020-06-06 20:11:22 +00:00
COPY --from=build /build/dist/frontend /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
2020-06-06 20:11:22 +00:00
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"]