Skip to content

Commit 19522b0

Browse files
committed
Make adjusts into docker-compose file and make file to execute test
1 parent 610385a commit 19522b0

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

Docker/test.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,7 @@ USER ${USERNAME}
4242
RUN npm cache clean --force && npm install
4343
EXPOSE 4200
4444
EXPOSE 9876
45-
CMD npm run config && npm run test
45+
46+
FROM development as build
47+
COPY .env .
48+
RUN npm run config && npm run test

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ remove: ## Delete container timetracker_ui.
4040

4141
.PHONY: test
4242
test: ## Run all tests on docker container timetracker_ui at the CLI.
43-
docker-compose build timetracker_ui
44-
docker-compose up -d timetracker_ui
43+
docker-compose up -d timetracker_ui_test
4544
docker exec timetracker_ui bash -c "npm run ci-test"
4645

4746
.PHONY: testdev

docker-compose.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ services:
2626
container_name: timetracker_ui_prod
2727
image: timetracker_ui_prod
2828
build:
29-
# target: production
3029
context: .
3130
dockerfile: ./Docker/prod.Dockerfile
3231
ports:
@@ -45,17 +44,11 @@ services:
4544
SCOPES_JSON: ${SCOPES_JSON}
4645

4746
timetracker_ui_test:
48-
container_name: timetracker_ui_test
47+
container_name: timetracker_ui
4948
image: timetracker_ui
5049
build:
51-
# target: production
5250
context: .
53-
dockerfile:
54-
./Docker/dev.Dockerfile
55-
./Docker/test.Dockerfile
56-
ports:
57-
- 4200:4200
58-
- 9876:9876
51+
dockerfile: ./Docker/test.Dockerfile
5952
environment:
6053
CHROME_BIN: /opt/google/chrome/google-chrome
6154
AUTHORITY: ${AUTHORITY}
@@ -66,5 +59,4 @@ services:
6659
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${AZURE_APP_CONFIGURATION_CONNECTION_STRING}
6760
AUTHORITY_JSON: ${AUTHORITY_JSON}
6861
CLIENT_ID_JSON: ${CLIENT_ID_JSON}
69-
SCOPES_JSON: ${SCOPES_JSON}
70-
62+
SCOPES_JSON: ${SCOPES_JSON}

0 commit comments

Comments
 (0)