Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
44 lines
942 B
YAML
44 lines
942 B
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: opengoods
|
|
POSTGRES_PASSWORD: opengoods
|
|
POSTGRES_DB: opengoods
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U opengoods"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
api:
|
|
build: ./api
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
OPENGOODS_ADDR: ":8080"
|
|
OPENGOODS_DATABASE_URL: "postgres://opengoods:opengoods@postgres:5432/opengoods?sslmode=disable"
|
|
OPENGOODS_REDIS_URL: "redis://redis:6379/0"
|
|
ports:
|
|
- "8080:8080"
|
|
|
|
volumes:
|
|
pgdata:
|