11services :
2+ postgres :
3+ image : postgres:15
4+ environment :
5+ POSTGRES_USER : postgres
6+ POSTGRES_PASSWORD : postgres
7+ POSTGRES_DB : postgres
8+ ports :
9+ - " 5432:5432"
10+ healthcheck :
11+ test : ["CMD", "pg_isready", "-U", "postgres"]
12+ interval : 5s
13+ timeout : 3s
14+ retries : 5
15+
216 redis :
317 image : redis:7
418 ports :
@@ -15,9 +29,9 @@ services:
1529 ports :
1630 - " 8000:8000"
1731 environment :
18- SUPABASE_URL : ${SUPABASE_URL:-http://host.docker.internal:54321 }
19- SUPABASE_KEY : ${SUPABASE_KEY}
20- SUPABASE_DB_URL : postgresql://postgres:postgres@host.docker.internal:54322 /postgres
32+ SUPABASE_URL : ${SUPABASE_URL:-http://postgres:5432 }
33+ SUPABASE_KEY : ${SUPABASE_KEY:-test-key }
34+ SUPABASE_DB_URL : ${SUPABASE_DB_URL:- postgresql://postgres:postgres@postgres:5432 /postgres}
2135 REDIS_URL : redis://redis:6379/0
2236 CELERY_BROKER_URL : redis://redis:6379/0
2337 CELERY_RESULT_BACKEND : redis://redis:6379/1
@@ -26,6 +40,8 @@ services:
2640 volumes :
2741 - ./src:/app/src
2842 depends_on :
43+ postgres :
44+ condition : service_healthy
2945 redis :
3046 condition : service_healthy
3147 healthcheck :
@@ -39,25 +55,28 @@ services:
3955 build : .
4056 command : celery -A policyengine_api.tasks.celery_app worker --loglevel=info
4157 environment :
42- SUPABASE_URL : ${SUPABASE_URL:-http://host.docker.internal:54321 }
43- SUPABASE_KEY : ${SUPABASE_KEY}
44- SUPABASE_DB_URL : postgresql://postgres:postgres@host.docker.internal:54322 /postgres
58+ SUPABASE_URL : ${SUPABASE_URL:-http://postgres:5432 }
59+ SUPABASE_KEY : ${SUPABASE_KEY:-test-key }
60+ SUPABASE_DB_URL : ${SUPABASE_DB_URL:- postgresql://postgres:postgres@postgres:5432 /postgres}
4561 REDIS_URL : redis://redis:6379/0
4662 CELERY_BROKER_URL : redis://redis:6379/0
4763 CELERY_RESULT_BACKEND : redis://redis:6379/1
4864 LOGFIRE_TOKEN : ${LOGFIRE_TOKEN}
4965 volumes :
5066 - ./src:/app/src
5167 depends_on :
52- - redis
68+ postgres :
69+ condition : service_healthy
70+ redis :
71+ condition : service_healthy
5372
5473 test :
5574 build : .
5675 command : pytest tests/ -v
5776 environment :
58- SUPABASE_URL : ${SUPABASE_URL:-http://host.docker.internal:54321 }
59- SUPABASE_KEY : ${SUPABASE_KEY}
60- SUPABASE_DB_URL : postgresql://postgres:postgres@host.docker.internal:54322 /postgres
77+ SUPABASE_URL : ${SUPABASE_URL:-http://postgres:5432 }
78+ SUPABASE_KEY : ${SUPABASE_KEY:-test-key }
79+ SUPABASE_DB_URL : ${SUPABASE_DB_URL:- postgresql://postgres:postgres@postgres:5432 /postgres}
6180 REDIS_URL : redis://redis:6379/0
6281 CELERY_BROKER_URL : redis://redis:6379/0
6382 CELERY_RESULT_BACKEND : redis://redis:6379/1
@@ -66,6 +85,8 @@ services:
6685 - ./src:/app/src
6786 - ./tests:/app/tests
6887 depends_on :
88+ postgres :
89+ condition : service_healthy
6990 redis :
7091 condition : service_healthy
7192 api :
0 commit comments