-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
47 lines (44 loc) · 971 Bytes
/
docker-compose.yml
File metadata and controls
47 lines (44 loc) · 971 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
services:
app:
build: .
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
environment:
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=url_shortener
command: >
sh -c "alembic upgrade head &&
uvicorn app.main:app --host 0.0.0.0 --port 8000"
volumes:
- ./app:/app/app
networks:
- app-network
postgres:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=url_shortener
ports:
- "5432:5432"
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_data:
name: url_shortener_postgres_data
networks:
app-network:
driver: bridge