forked from alfredfrancis/ai-chatbot-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
bef666f
commit 86471dc
Showing
3 changed files
with
41 additions
and
1 deletion.
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,33 @@ | ||
### STAGE 1: Build ### | ||
|
||
# We label our stage as 'builder' | ||
FROM node:8-alpine as builder | ||
|
||
COPY package.json package-lock.json ./ | ||
|
||
RUN npm set progress=false && npm config set depth 0 && npm cache clean --force | ||
|
||
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build | ||
RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app | ||
|
||
WORKDIR /ng-app | ||
|
||
COPY . . | ||
|
||
## Build the angular app in production mode and store the artifacts in dist folder | ||
RUN $(npm bin)/ng build --prod --build-optimizer | ||
|
||
### STAGE 2: Setup ### | ||
|
||
FROM nginx:1.13.3-alpine | ||
|
||
## Copy our default nginx config | ||
COPY nginx/default.conf /etc/nginx/conf.d/ | ||
|
||
## 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 | ||
|
||
CMD ["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