-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (49 loc) · 1.04 KB
/
docker-compose.yml
File metadata and controls
52 lines (49 loc) · 1.04 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
services:
app:
container_name: app_service
build:
context: .
dockerfile: app/Dockerfile
args:
APP_PORT: ${APP_PORT:-8000}
env_file:
- .env
environment:
DB_HOST: db
CACHE_HOST: cache
ports:
- "${APP_PORT}:${APP_PORT}"
volumes:
- ./:/app
depends_on:
- db
- cache
command: >
sh -c "
uv run alembic upgrade head &&
uv run uvicorn app.main:app --host 0.0.0.0 --port \$${APP_PORT:-8000}
"
db:
container_name: app_db
image: postgres:latest
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "${DB_PORT}:5432"
volumes:
- db_data:/var/lib/postgresql
restart: unless-stopped
cache:
container_name: app_cache
image: redis:latest
ports:
- "${CACHE_PORT}:6379"
volumes:
- cache_data:/data
command: ["redis-server", "--appendonly", "yes"]
restart: unless-stopped
volumes:
db_data:
cache_data: