Skip to content

Commit

Permalink
Rework local container setup for testing #1196
Browse files Browse the repository at this point in the history
  • Loading branch information
dennissiemensma committed Jun 10, 2024
1 parent b9afabd commit f710f10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
3 changes: 1 addition & 2 deletions provisioning/container/Containerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -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"]


# -----------------------------------------------------------
Expand Down
22 changes: 5 additions & 17 deletions provisioning/container/compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f710f10

Please sign in to comment.