-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile-try
49 lines (31 loc) · 1.19 KB
/
Dockerfile-try
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#----------------------
### STAGE 1: BUILD ###
#---------------------
# Building node from LTS version
FROM node:12.14 as build
# set working directory
WORKDIR /build
# add `/app/node_modules/.bin` to $PATH
ENV PATH /node_modules/.bin:$PATH
# Copying all necessary files required for npm install
COPY package*.json ./
# Install npm dependencies in a different folder to optimize container build process
RUN npm install && npm install -g @angular/cli
# Copying application code to container application directory
COPY . .
# Building the angular app
# RUN ng build --configuration production --output-path=/dist
RUN ng build --prod --output-path docs --base-href ng-karaoke
#--------------------------------------------------
### STAGE 2: Setup nginx and Deploy application ###
#--------------------------------------------------
#FROM nginx:alpine
## Copy defualt nginx configuration file>
#COPY --from=build ./dist /usr/share/nginx/html
#COPY ./nginx/nginx-custom.conf /etc/nginx/conf.d/default.conf
ENV TZ="America/Costa_Rica"
# expose port 80
EXPOSE 80
# CMD ["nginx","-g","daemon off;"]
# When the container starts, replace the env.js with values from environment variables
CMD ["ng", "serve"]