-
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
e28dd94
commit d2ac471
Showing
1 changed file
with
19 additions
and
6 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,14 +1,27 @@ | ||
# FIRST STAGE | ||
# Define the base image | ||
FROM node:alpine | ||
FROM node:20.12.2 as build | ||
|
||
# Create a folder and copy the folder structure from local | ||
# Create a folder, and copy package.json and package-lock.json to it | ||
WORKDIR /app | ||
COPY . /app | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install -g @angular/cli | ||
RUN npm install | ||
|
||
EXPOSE 4200 | ||
# Install Angular | ||
RUN npm install -g @angular/cli | ||
|
||
# Copy all the files in the current directory to the container | ||
COPY . ./ | ||
|
||
# Build the Angular application | ||
RUN ng build --configuration=production | ||
|
||
# SECOND STAGE | ||
# Define the base image | ||
FROM nginx:latest | ||
|
||
COPY --from=build app/dist/aftas-angular /usr/share/nginx/html | ||
|
||
CMD ["ng", "serve", "--host", "0.0.0.0", "--port", "4200"] | ||
EXPOSE 80 |