File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ .git
2
+ .editorconfig
3
+ /.vscode /*
4
+ /node_modules
5
+ /e2e
6
+ /docs
7
+ .gitignore
8
+ * .zip
Original file line number Diff line number Diff line change
1
+ # From the source https://dev.to/oneofthedevs/docker-angular-nginx-37e4
2
+
3
+ FROM node:20-alpine AS build
4
+
5
+ WORKDIR /dist/src/app
6
+
7
+ RUN npm cache clean --force
8
+ COPY . .
9
+ RUN npm install
10
+ RUN npm run build
11
+
12
+
13
+ # ## STAGE 2:RUN ###
14
+ # Defining nginx image to be used
15
+ FROM nginx:latest AS ngi
16
+ # Copying compiled code and nginx config to different folder
17
+ # NOTE: This path may change according to your project's output folder
18
+ COPY --from=build /dist/src/app/dist/angular-spa /usr/share/nginx/html
19
+ COPY /nginx.conf /etc/nginx/conf.d/default.conf
20
+ # Exposing a port, here it means that inside the container
21
+ # the app will be using Port 80 while running
22
+ EXPOSE 80
Original file line number Diff line number Diff line change
1
+ server {
2
+ listen 80 ;
3
+ sendfile on ;
4
+ default_type application/octet-stream;
5
+
6
+ gzip on ;
7
+ gzip_http_version 1.1 ;
8
+ gzip_disable "MSIE [1-6]\." ;
9
+ gzip_min_length 256 ;
10
+ gzip_vary on ;
11
+ gzip_proxied expired no-cache no-store private auth;
12
+ gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
13
+ gzip_comp_level 9 ;
14
+
15
+ root /usr/share/nginx/html;
16
+
17
+ location / {
18
+ try_files $uri $uri / /index.html =404 ;
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments