Dockerfile Client Side Builds
MD
R
MarkdownDockerfile for static client apps
Build
FROM mhart/alpine-node:10 AS builder
RUN npm config set unsafe-perm true
RUN npm install -g @angular/cli
WORKDIR /project
COPY package.json package.json COPY package-lock.json package-lock.json
RUN npm install
COPY . .
RUN npm run build
RUN node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --prod
Server
FROM nginx:1.15.4-alpine
WORKDIR /var/www
COPY --from=builder /project/dist/flow-client/ .
RUN ls -laht
ENV NODE_ENV=production ENV PORT=80
COPY nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE $PORT
Created on 9/27/2019