Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
138 lines (130 loc) · 3.4 KB
/
Copy pathdocker-compose.yml
File metadata and controls
138 lines (130 loc) · 3.4 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
services:
backend:
build:
context: ./src/backend
dockerfile: Dockerfile
environment:
PYTHONPATH: /app
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
REDIS_URL: redis://redis:6379/0
ALLOWED_HOSTS: '["localhost","127.0.0.1","frontend"]'
CORS_ORIGINS: '["http://localhost:5173","http://frontend:5173"]'
CORS_ALLOW_CREDENTIALS: "true"
env_file:
- config/environments/development.env
- .env
volumes:
- ./src/backend:/app
- ./config:/app/config:ro
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
worker:
build:
context: ./src/backend
dockerfile: Dockerfile
environment:
PYTHONPATH: /app
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
REDIS_URL: redis://redis:6379/0
env_file:
- config/environments/development.env
- .env
volumes:
- ./src/backend:/app
- ./config:/app/config:ro
depends_on:
backend:
condition: service_started
redis:
condition: service_healthy
ml-inference:
condition: service_started
command: celery -A app.celery_app.celery_app worker --loglevel=info
flower:
build:
context: ./src/backend
dockerfile: Dockerfile
environment:
PYTHONPATH: /app
env_file:
- config/environments/development.env
- .env
volumes:
- ./src/backend:/app
- ./config:/app/config:ro
depends_on:
worker:
condition: service_started
ports:
- "5555:5555"
command: celery -A app.celery_app.celery_app flower --port=5555 --address=0.0.0.0
ml-inference:
build:
context: ./src/ml
dockerfile: Dockerfile
env_file:
- config/environments/development.env
- .env
volumes:
- ./src/ml:/app
ports:
- "8500:8500"
command: uvicorn ltsr_ml.inference.server:app --host 0.0.0.0 --port 8500
frontend:
build:
context: ./src/frontend
dockerfile: Dockerfile
environment:
VITE_API_URL: "http://localhost:8000"
env_file:
- config/environments/development.env
- .env
volumes:
- ./src/frontend:/app
- /app/node_modules
ports:
- "5173:5173"
depends_on:
backend:
condition: service_started
command: npm run dev -- --host
db:
image: postgres:15
restart: unless-stopped
environment:
POSTGRES_USER: ltsr_user
POSTGRES_PASSWORD: ltsr_password
POSTGRES_DB: ltsr_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./config/database/init.sql:/docker-entrypoint-initdb.d/00-init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ltsr_user -d ltsr_db"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7
restart: unless-stopped
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
ports:
- "6379:6379"
volumes:
- redis_data:/data
- ./config/redis/redis.conf:/usr/local/etc/redis/redis.conf:ro
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
redis_data: