Skip to content

Commit

Permalink
Merge pull request #6488 from spwoodcock/build/dev-bind-mounts
Browse files Browse the repository at this point in the history
Add bind mounts to docker compose dev setup + migration command override
  • Loading branch information
dakotabenjamin authored Aug 13, 2024
2 parents e337f96 + e2d19c9 commit 09153d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 0 additions & 2 deletions docker-compose.override.sample.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

name: tasking-manager-main

services:
Expand Down
16 changes: 11 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

name: tasking-manager-main

volumes:
Expand All @@ -19,7 +17,7 @@ services:
- tasking-manager.env
restart: unless-stopped
healthcheck:
test: pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}
test: pg_isready -U ${POSTGRES_USER:-tm} -d ${POSTGRES_DB:-tasking-manager}
start_period: 35s
interval: 10s
timeout: 5s
Expand All @@ -38,6 +36,10 @@ services:
condition: service_completed_successfully
env_file:
- tasking-manager.env
volumes:
- ./pyproject.toml:/usr/src/app/pyproject.toml:ro
- ./backend:/usr/src/app/backend:ro
- ./tests:/usr/src/app/tests:ro
restart: unless-stopped
healthcheck:
test: curl --fail http://localhost:5000 || exit 1
Expand All @@ -64,14 +66,18 @@ services:
image: ghcr.io/hotosm/tasking-manager/backend:main
build:
context: .
entrypoint: ["python", "manage.py", "db", "upgrade"]
entrypoint: ["python", "manage.py", "db"]
command: "upgrade"
depends_on:
tm-db:
condition: service_healthy
env_file:
- tasking-manager.env
volumes:
- ./pyproject.toml:/usr/src/app/pyproject.toml:ro
- ./backend:/usr/src/app/backend:ro
- ./migrations:/usr/src/app/migrations:ro
deploy:
replicas: ${API_REPLICAS:-1}
resources:
limits:
cpus: "1"
Expand Down

0 comments on commit 09153d1

Please sign in to comment.