34 lines
614 B
YAML
34 lines
614 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
app:
|
|
build: .
|
|
ports:
|
|
- "8080:8180"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
- TZ=Asia/Shanghai
|
|
volumes:
|
|
- ./config.yaml:/app/config.yaml
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: root
|
|
POSTGRES_DB: training_db
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
ports:
|
|
- "127.0.0.1:5432:5432"
|
|
|
|
volumes:
|
|
pgdata:
|