-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
104 lines (97 loc) · 2.19 KB
/
docker-compose.yml
File metadata and controls
104 lines (97 loc) · 2.19 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
services:
postgres:
image: postgres:17
container_name: postgres_db_openlabs
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- fastapi_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:alpine
container_name: redis_queue_openlabs
command: ["redis-server", "--loglevel", "warning", "--requirepass", "${REDIS_QUEUE_PASSWORD}"]
volumes:
- redis_data:/data
networks:
- fastapi_network
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_QUEUE_PASSWORD}", "ping"]
interval: 5s
timeout: 5s
retries: 10
worker:
build:
target: worker
context: .
dockerfile: api/Dockerfile
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- fastapi_network
fastapi:
build:
context: .
dockerfile: api/Dockerfile
container_name: fastapi_app_openlabs
env_file:
- .env
ports:
- "${API_BIND_ADDR}:${API_PORT}:80"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- fastapi_network
init:
build:
context: .
dockerfile: api/Dockerfile
container_name: fastapi_init_openlabs
env_file:
- .env
command: ["python", "-m", "src.scripts.create_admin"]
depends_on:
fastapi:
condition: service_healthy
networks:
- fastapi_network
restart: on-failure
frontend:
build:
context: frontend
dockerfile: Dockerfile
args:
VITE_API_URL: ${API_URL}
ports:
- "${FRONTEND_PORT}:3000"
environment:
NODE_ENV: production
depends_on:
fastapi:
condition: service_healthy
networks:
- fastapi_network
profiles:
- frontend
volumes:
postgres_data:
redis_data:
networks:
fastapi_network:
driver: bridge