-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (51 loc) · 1.05 KB
/
Copy pathdocker-compose.yml
File metadata and controls
56 lines (51 loc) · 1.05 KB
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
51
52
53
54
55
56
version: '3.8'
services:
web:
build:
context: ./
dockerfile: dockerfiles/app.dockerfile
volumes:
- ./:/workspace:cached
env_file:
- .env
command: uvicorn app.main:app --reload --workers 1 --host 0.0.0.0 --port 8000
container_name: fastapi-app
ports:
- 8002:8000
depends_on:
web-db:
condition: service_healthy
web-db:
build:
context: ./
dockerfile: dockerfiles/db.dockerfile
container_name: fastapi-db
expose:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
env_file:
- .env
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 5s
retries: 5
redis:
image: redis:alpine
restart: unless-stopped
rqworker:
build:
context: ./
dockerfile: dockerfiles/app.dockerfile
command: rq worker --url redis://redis:6379
depends_on:
- redis
env_file:
- .env
networks:
- default
volumes:
postgres-data:
networks:
default:
driver: bridge