api/docker-compose.yml

48 lines
1.0 KiB
YAML

---
version: "3"
services:
postgres:
image: postgres:14-alpine
restart: unless-stopped
environment:
POSTGRES_PASSWORD: ytrssil
POSTGRES_USER: ytrssil
POSTGRES_DB: ytrssil
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 5s
timeout: 2s
retries: 5
api:
image: theedgeofrage/ytrssil:api
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
migrations:
image: theedgeofrage/ytrssil:migrations
restart: unless-stopped
depends_on:
- postgres
command:
- "-path=/migrations/"
- "-database"
- "postgresql://ytrssil:ytrssil@postgres/ytrssil?sslmode=disable"
- "up"
volumes:
postgres-data: