-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
49 lines (46 loc) · 943 Bytes
/
compose.yaml
File metadata and controls
49 lines (46 loc) · 943 Bytes
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
services:
db:
image: postgres:17
environment:
POSTGRES_DB: shortener
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
cache:
image: redis:7
ports:
- "6379:6379"
env_file:
- .env
web:
build: .
command: >
sh -c "uv run alembic upgrade head &&
uv run uvicorn app.main:app --port 8000 --host 0.0.0.0 --reload"
container_name: url-shortener
ports:
- "8000:8000"
user: root
depends_on:
db:
condition: service_healthy
develop:
watch:
- action: sync
path: .
target: /app
initial_sync: true
- action: rebuild
path: uv.lock
env_file:
- .env
volumes:
postgres_data: