-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
50 lines (46 loc) · 1.26 KB
/
docker-compose.yml
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
x-logging: &logging
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
x-restart-policy: &restart_policy
restart: unless-stopped
x-secure-containers: &secure_containers
privileged: false
read_only: true # Prod uses a read-only fs, override this locally if it helps with debugging
user: "65534" # Prod uses a non-root user, override this locally if it helps with debugging
services:
postgres:
<< : *logging
<< : *restart_policy
image: postgres:13-alpine
ports:
- "127.0.0.1:7777:5432"
environment:
POSTGRES_DB: codejam_management
POSTGRES_PASSWORD: codejam_management
POSTGRES_USER: codejam_management
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U codejam_management" ]
interval: 2s
timeout: 1s
retries: 5
api:
<< : *logging
<< : *restart_policy
<< : *secure_containers
build:
context: .
args:
- uvicorn_extras=--reload
volumes:
- ./alembic/versions:/app/alembic/versions
- .:/app:ro
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgresql+asyncpg://codejam_management:codejam_management@postgres:5432/codejam_management
ports:
- 5000:8000