Skip to content

Commit 01def58

Browse files
author
Rodolfo
committed
split docker files
1 parent 2db3eec commit 01def58

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

.github/workflows/time-tracker-ui-cd-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Build the docker image
3939
run: |-
4040
docker build \
41-
--target production_prod -t timetracker_ui \
41+
--target production_prod -t timetracker_ui -f Dockerfile_prod \
4242
.
4343
4444
- name: Publish docker image to prod azure container registry

.github/workflows/time-tracker-ui-cd-stage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Build the docker image
3939
run: |-
4040
docker build \
41-
--target production_stage -t timetracker_ui \
41+
--target production -t timetracker_ui -f Dockerfile_stage \
4242
.
4343
4444
- name: Publish docker image to stage azure container registry

Dockerfile

Lines changed: 0 additions & 26 deletions
This file was deleted.

Dockerfile_prod

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:14-alpine AS building
2+
WORKDIR /app
3+
COPY . /app
4+
RUN npm cache clean --force && npm install
5+
EXPOSE 4200 9876
6+
RUN source .prod.env && npm run build
7+
8+
9+
FROM nginx:1.21 AS production
10+
COPY nginx.conf /etc/nginx/conf.d/default.conf
11+
COPY --from=building /app/dist/time-tracker /usr/share/nginx/html
12+
EXPOSE 80
13+

Dockerfile_stage

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:14-alpine AS building
2+
WORKDIR /app
3+
COPY . /app
4+
RUN npm cache clean --force && npm install
5+
EXPOSE 4200 9876
6+
RUN source .stage.env && npm run build
7+
8+
9+
FROM nginx:1.21 AS production
10+
COPY nginx.conf /etc/nginx/conf.d/default.conf
11+
COPY --from=building /app/dist/time-tracker /usr/share/nginx/html
12+
EXPOSE 80
13+

0 commit comments

Comments
 (0)