-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
81 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
### STAGE 1: Build ### | ||
|
||
# We label our stage as ‘builder’ | ||
FROM node:14.21.2-alpine as builder | ||
|
||
COPY package.json package-lock.json ./ | ||
|
||
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build | ||
|
||
RUN npm ci && mkdir /ng-app && mv ./node_modules ./ng-app | ||
|
||
WORKDIR /ng-app | ||
|
||
COPY . . | ||
|
||
## Build the angular app in production mode and store the artifacts in dist folder | ||
|
||
RUN npm run ng build --configuration="prod" --output-path=dist --base-href="./" --output-hashing=none --build-optimizer=true --vendor-chunk | ||
|
||
|
||
### STAGE 2: Setup ### | ||
|
||
FROM nginx:1.14.1-alpine | ||
|
||
## Copy our default nginx config | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
## Remove default nginx website | ||
RUN rm -rf /usr/share/nginx/html/* | ||
|
||
## 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 | ||
|
||
RUN echo "Tiledesk Design Studio Started!!" | ||
|
||
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/design-studio-config-template.json > /usr/share/nginx/html/design-studio-config.json && exec nginx -g 'daemon off;'"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
worker_processes 1; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
include /etc/nginx/mime.types; | ||
|
||
gzip on; | ||
gzip_min_length 1000; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters