-
Notifications
You must be signed in to change notification settings - Fork 1
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
285ebc2
commit 6e13ef3
Showing
1 changed file
with
9 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
FROM node:18.16.0 | ||
FROM node:18.16.0 as builder | ||
|
||
ARG NODE_ENV | ||
RUN npm install -g @angular/[email protected] | ||
RUN mkdir /code | ||
|
||
WORKDIR /code | ||
# Copy codebase | ||
COPY ./ /code/ | ||
|
||
WORKDIR /code | ||
COPY frontend/package.json frontend/yarn.lock /code/ | ||
RUN npm update | ||
|
||
ADD frontend/package.json frontend/yarn.lock /code/ | ||
RUN yarn install | ||
ENV PATH="/code/node_modules/.bin:$PATH" | ||
ENV PATH="/code/node_modules/.bin:$PATH" | ||
COPY frontend/ /code | ||
RUN ng build --prod --configuration=${NODE_ENV} | ||
RUN ng build --configuration=${NODE_ENV} | ||
|
||
FROM nginx:1.25.1-alpine | ||
ARG NODE_ENV | ||
COPY docker/prod/nodejs_v1/nginx_${NODE_ENV}.conf /etc/nginx/conf.d/default.conf | ||
COPY --from=node /code/dist /usr/share/nginx/html | ||
COPY --from=builder /code/dist /usr/share/nginx/html |