-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
50 lines (47 loc) · 1.17 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
version: "3.9"
services:
app:
build: .
ports:
- "8000:8000"
environment:
- DEBUG=True
- DB_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/postgres
- CACHE_URL=redis://redis:6379/0
- SECRET_KEY=qj1s3ewkrtyuio
- GOOGLE_API_KEY=AIzaSyA7GLNl5VMbpNInRjTkBWBucuArdNSLUd0
depends_on:
postgres:
condition: service_started
migrate:
condition: service_completed_successfully
command: uvicorn app.main:create_app --factory --host 0.0.0.0 --port 8000
migrate:
build: .
environment:
- DB_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/postgres
depends_on:
postgres:
condition: service_started
command: alembic upgrade head
redis:
image: redis:alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
postgres:
image: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5