-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
45 lines (43 loc) · 1.37 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
services:
db:
image: postgres:17-alpine
container_name: python3-template-project-db
ports:
- "5432:5432"
environment:
POSTGRES_DB: "${POSTGRES_DB:-db}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-dev}"
POSTGRES_USER: "${POSTGRES_USER:-dev}"
pgweb:
image: sosedoff/pgweb
container_name: python3-template-project-pgweb
ports:
- "8081:8081"
environment:
DATABASE_URL: "postgresql://${POSTGRES_USER:-dev}:${POSTGRES_PASSWORD:-dev}@${POSTGRES_HOST:-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-db}?sslmode=disable"
entrypoint: /bin/bash
command: [
"-c",
"until pg_isready -h ${POSTGRES_HOST:-db} -d ${POSTGRES_DB:-db}; do echo 'wait for db'; sleep 1; done && pgweb --bind=0.0.0.0"
]
depends_on:
- db
python3-template-service:
build:
context: ./
dockerfile: Dockerfile
image: python3-template-service
container_name: python3-template-project-service
ports:
- "8080:8080"
environment:
DB_DSN: "postgresql://${POSTGRES_USER:-dev}:${POSTGRES_PASSWORD:-dev}@${POSTGRES_HOST:-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-db}"
DB_POOL_MIN_SIZE: 1
DB_POOL_MAX_SIZE: 50
TCP_MAX_SYN_BACKLOG: 8191
SERVICE_ADDR: "0.0.0.0"
SERVICE_PORT: 8080
ALEMBIC_AUTO_UPGRADE: 1
LOGGING_LEVEL: "${LOGGING_LEVEL:-DEBUG}"
depends_on:
- db