forked from PavelLopatin/sqlalchemy-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
46 lines (41 loc) · 1004 Bytes
/
compose.yaml
File metadata and controls
46 lines (41 loc) · 1004 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
services:
nginx:
command: nginx -g "daemon off;"
depends_on:
- api
image: nginx:alpine
restart: on-failure
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
- "127.0.0.1:8000:8000"
postgres:
image: postgres:17.5-alpine
container_name: postgres
command:
- "postgres"
- "-c"
- "max_connections=1000"
- "-c"
- "statement_timeout=${DB_STATEMENT_TIMEOUT:-300s}"
- "-c"
- "idle_in_transaction_session_timeout=${DB_IDLE_IN_TRANSACTION_SESSION_TIMEOUT:-300s}"
volumes:
- postgresql-data:/var/lib/postgresql/data
restart: on-failure
env_file:
- src/.env
api:
build:
context: src
dockerfile: ./Dockerfile
restart: on-failure
command: bash -c "alembic upgrade head; uvicorn apps.main:app --host 0.0.0.0 --port 8000 --reload"
depends_on:
- postgres
volumes:
- ./src/:/app/
env_file:
- src/.env
volumes:
postgresql-data: