Skip to content
Prev Previous commit
Next Next commit
Make adjusts into docker-compose file and make file to execute test
  • Loading branch information
sbateca committed May 11, 2022
commit 19522b0554e0f7aed5cafab06a6118d4add37ff2
5 changes: 4 additions & 1 deletion Docker/test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ USER ${USERNAME}
RUN npm cache clean --force && npm install
EXPOSE 4200
EXPOSE 9876
CMD npm run config && npm run test

FROM development as build
COPY .env .
RUN npm run config && npm run test
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ remove: ## Delete container timetracker_ui.

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

.PHONY: testdev
Expand Down
14 changes: 3 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ services:
container_name: timetracker_ui_prod
image: timetracker_ui_prod
build:
# target: production
context: .
dockerfile: ./Docker/prod.Dockerfile
ports:
Expand All @@ -45,17 +44,11 @@ services:
SCOPES_JSON: ${SCOPES_JSON}

timetracker_ui_test:
container_name: timetracker_ui_test
container_name: timetracker_ui
image: timetracker_ui
build:
# target: production
context: .
dockerfile:
./Docker/dev.Dockerfile
./Docker/test.Dockerfile
ports:
- 4200:4200
- 9876:9876
dockerfile: ./Docker/test.Dockerfile
environment:
CHROME_BIN: /opt/google/chrome/google-chrome
AUTHORITY: ${AUTHORITY}
Expand All @@ -66,5 +59,4 @@ services:
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${AZURE_APP_CONFIGURATION_CONNECTION_STRING}
AUTHORITY_JSON: ${AUTHORITY_JSON}
CLIENT_ID_JSON: ${CLIENT_ID_JSON}
SCOPES_JSON: ${SCOPES_JSON}

SCOPES_JSON: ${SCOPES_JSON}