-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 1.02 KB
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
31
32
33
34
35
#FROM nginx:1.19.8-alpine
#COPY ./nginx.conf /etc/nginx/conf.d/default.conf
#COPY ./dist/ /usr/share/nginx/html/
# Usage:
#
# Build image:
# docker build -t file-server-angular .
#
# Run image (on localhost:32020):
# docker run -d --name file-server-angular -p 32020:80 file-server-angular
#
# Run image as virtual host (read more: https://github.com/nginx-proxy/nginx-proxy):
# docker run -e VIRTUAL_HOST=file-server-angular --name file-server-angular file-server-angular
#
# Stage 1, based on Node.js, to build and compile Angular
FROM node:14.17.0-alpine as builder
WORKDIR /ng-app
COPY package*.json tsconfig*.json angular.json ./
COPY ./src ./src
RUN npm ci --quiet && npm run build-vdi --verbose
# 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