/
docker-compose.yml
60 lines (59 loc) · 1.48 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
51
52
53
54
55
56
57
58
59
60
volumes:
postgresql-data:
services:
database:
image: postgres:16
restart: always
expose:
- "5432"
ports:
- "5432:5432"
volumes:
- postgresql-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_DB: cawadb
POSTGRES_PASSWORD: postgrespw
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 10
web:
container_name: cawa
build:
context: .
dockerfile: Dockerfile.dev
target: web
command: uvicorn --host 0.0.0.0 cawa.main:app
environment:
DATABASE_URL: postgresql+psycopg://postgres:postgrespw@database:5432/cawadb
SECRET_KEY: "this actually should be a better secret, but it works"
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 15
DEBUG: 1
volumes:
- ./src:/app/cawa
ports:
- "8000:8000"
depends_on:
database:
condition: service_healthy
migrations:
condition: service_completed_successfully
migrations:
build:
context: .
dockerfile: Dockerfile.dev
target: migrations
command: alembic upgrade head
environment:
DATABASE_URL: postgresql+psycopg://postgres:postgrespw@database:5432/cawadb
SECRET_KEY: "this actually should be a better secret, but it works"
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 15
volumes:
- ./src:/app/cawa
depends_on:
database:
condition: service_healthy