39 lines
756 B
YAML
39 lines
756 B
YAML
|
---
|
||
|
version: "3"
|
||
|
services:
|
||
|
postgres:
|
||
|
image: postgres:14-alpine
|
||
|
restart: unless-stopped
|
||
|
ports:
|
||
|
- "5431:5432"
|
||
|
environment:
|
||
|
POSTGRES_PASSWORD: ytrssil
|
||
|
POSTGRES_USER: ytrssil
|
||
|
POSTGRES_DB: ytrssil
|
||
|
volumes:
|
||
|
- postgres-data:/var/lib/postgresql/data
|
||
|
healthcheck:
|
||
|
test: pg_isready
|
||
|
interval: 5s
|
||
|
timeout: 2s
|
||
|
retries: 5
|
||
|
|
||
|
api:
|
||
|
build: .
|
||
|
restart: unless-stopped
|
||
|
depends_on:
|
||
|
- postgres
|
||
|
environment:
|
||
|
DB_URI: "postgresql://ytrssil:ytrssil@postgres/ytrssil?sslmode=disable"
|
||
|
PORT: "80"
|
||
|
ports:
|
||
|
- "8080:80"
|
||
|
healthcheck:
|
||
|
test: "curl http://localhost:80/healthz"
|
||
|
interval: 5s
|
||
|
retries: 5
|
||
|
timeout: 2s
|
||
|
|
||
|
volumes:
|
||
|
postgres-data:
|