Skip to content

Commit 4ed4c68

Browse files
committed
adding args and make file
1 parent 5443de1 commit 4ed4c68

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

Dockerfile

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@ USER ${USERNAME}
1212
RUN npm cache clean --force && npm install
1313
EXPOSE 4200
1414
EXPOSE 9876
15-
CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck
15+
ARG API_URL
16+
ARG AUTHORITY
17+
ARG CLIENT_ID
18+
ARG CLIENT_URL
19+
ARG SCOPES
20+
ARG AZURE_APP_CONFIGURATION_CONNECTION_STRING
21+
22+
RUN API_URL=${API_URL} \
23+
AUTHORITY=${AUTHORITY} \
24+
CLIENT_ID=${CLIENT_ID} \
25+
CLIENT_URL=${CLIENT_URL} \
26+
SCOPES=${SCOPES} \
27+
AZURE_APP_CONFIGURATION_CONNECTION_STRING=${AZURE_APP_CONFIGURATION_CONNECTION_STRING}
1628

17-
18-
19-
FROM development as build
20-
ENV TEST "$SCOPES"
21-
ENV TEST1 "$API_URL"
22-
# ENV CLIENT_ID "$CLIENT_ID"
23-
# ENV CLIENT_URL "$CLIENT_URL"
24-
# ENV AUTHORITY "$AUTHORITY"
25-
# # ENV STACK_EXCHANGE_ID "$STACK_EXCHANGE_ID"
26-
# # ENV STACK_EXCHANGE_ACCESS_TOKEN "$STACK_EXCHANGE_ACCESS_TOKEN"
27-
# ENV AZURE_APP_CONFIGURATION_CONNECTION_STRING "$AZURE_APP_CONFIGURATION_CONNECTION_STRING"
28-
RUN chmod +x ./scripts/populate-keys.sh
29-
RUN sh ./scripts/populate-keys.sh
3029
RUN npm run build
3130

3231
FROM nginx:1.21 AS production
@@ -35,7 +34,7 @@ ENV USERNAME app
3534
RUN useradd -ms /bin/bash ${USERNAME}
3635

3736
COPY nginx.conf /etc/nginx/conf.d/default.conf
38-
COPY --from=build /home/timetracker/time-tracker-ui/dist/time-tracker /usr/share/nginx/html
37+
COPY --from=development /home/timetracker/time-tracker-ui/dist/time-tracker /usr/share/nginx/html
3938
# COPY .env /usr/share/nginx/html
4039
RUN chown -R ${USERNAME}:${USERNAME} /var/cache/nginx && \
4140
chown -R ${USERNAME}:${USERNAME} /var/log/nginx && \

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ publish: require-acr-arg require-image_tag-arg ## Upload a docker image to the s
5656

5757
.PHONY: build_prod
5858
build_prod: ## Create docker image with dependencies needed for production.
59-
docker build --target production -t timetracker_ui -f Dockerfile .
59+
docker build --target production -t timetracker_ui -f Dockerfile .
6060

6161
.PHONY: run_prod
6262
run_prod: ## Execute timetracker_ui_prod docker container.
63-
docker run -d -p 80:80 --env-file ./.env --name timetracker_ui_prod timetracker_ui
63+
docker run -d -p 80:80 --name timetracker_ui_prod timetracker_ui
6464

6565
.PHONY: stop_prod
6666
stop_prod: ## Stop container timetracker_ui_prod.

0 commit comments

Comments
 (0)