-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (45 loc) · 1006 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
45 lines (45 loc) · 1006 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
version: "3.9"
services:
postgres:
container_name: postgres
image: postgres:15.1-alpine
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${DB_SCHEMA}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
ports:
- ${DB_PORT}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_SCHEMA}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1'
memory: 1G
app:
build:
context: .
ports:
- "8000:8000"
container_name: bewise
depends_on:
- postgres
entrypoint: >
sh -c
"
echo Applying alembic migration...
alembic upgrade head
echo Running tests...
pytest
echo Starting uvicorn server...
uvicorn app.main:app --host 0.0.0.0
"
volumes:
postgres-data: