From f710f10a6fb0084a773d3f49f4b647094512c069 Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Mon, 10 Jun 2024 22:21:08 +0200 Subject: [PATCH] Rework local container setup for testing #1196 --- provisioning/container/Containerfile-dev | 3 +-- provisioning/container/compose.dev.yml | 22 +++++----------------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/provisioning/container/Containerfile-dev b/provisioning/container/Containerfile-dev index 6249c2c3..12450e65 100644 --- a/provisioning/container/Containerfile-dev +++ b/provisioning/container/Containerfile-dev @@ -24,12 +24,11 @@ COPY ./src/pyproject.toml ./src/poetry.lock /app/ RUN pip install poetry RUN poetry install --no-root --with dev EXPOSE 8000 -ENTRYPOINT poetry run python manage.py runserver 0.0.0.0:8000 +ENTRYPOINT ["poetry", "run"] FROM local-dsmrreader-dev AS local-dsmrreader-test EXPOSE "" -ENTRYPOINT ["poetry", "run"] # ----------------------------------------------------------- diff --git a/provisioning/container/compose.dev.yml b/provisioning/container/compose.dev.yml index cbdb2dbb..19be60eb 100644 --- a/provisioning/container/compose.dev.yml +++ b/provisioning/container/compose.dev.yml @@ -7,6 +7,7 @@ services: dev-dsmr-app: container_name: dev-dsmr-app restart: 'unless-stopped' + command: '/app/manage.py runserver 0.0.0.0:8000' build: context: . dockerfile: provisioning/container/Containerfile-dev @@ -44,7 +45,8 @@ services: # Only use for restoring DB-backups. E.g.: psql -U dsmrreader -f /run/host/Desktop/dsmrreader-postgresql-backup-Tuesday.sql dsmrreader - ~/Desktop:/run/host/Desktop/ - dsmr-docs-en: # http://localhost:10000 + # http://localhost:10000 + dsmr-docs-en: container_name: dsmr-docs-en restart: 'unless-stopped' build: @@ -56,7 +58,8 @@ services: ports: - '10000:10000' - dsmr-docs-nl: # http://localhost:10001 + # http://localhost:10001 + dsmr-docs-nl: container_name: dsmr-docs-nl restart: 'unless-stopped' build: @@ -88,21 +91,6 @@ services: ##### Automated testing ##### - tests-dsmr-app: - container_name: tests-dsmr-app - restart: 'no' - build: - context: . - dockerfile: provisioning/container/Containerfile-dev - target: local-dsmrreader-test - volumes: - - ./src:/app - depends_on: - tests-dsmr-db: - condition: service_healthy - env_file: - - provisioning/container/test.env - tests-dsmr-db: container_name: tests-dsmr-db image: postgres:15-alpine