-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
30 lines (21 loc) · 951 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Usage:
#
# Build image:
# docker build -t jojozhuang/text-compare-angular .
#
# Run image (on localhost:12010):
# docker run -d --name text-compare -p 12010:80 jojozhuang/text-compare-angular
#
# Run image as virtual host (read more: https://github.com/nginx-proxy/nginx-proxy):
# docker run -e VIRTUAL_HOST=text-compare.your-domain.com --name text-compare jojozhuang/text-compare-angular
# Stage 1, based on Node.js, to build and compile Angular
FROM node:16.10.0-alpine as builder
WORKDIR /ng-app
COPY package*.json tsconfig*.json angular.json ./
COPY ./src ./src
RUN npm ci --quiet && npm run build-nas
# Stage 2, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:1.19.8-alpine
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
## From ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder
COPY --from=builder /ng-app/dist /usr/share/nginx/html