66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
name: goods
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: api/Dockerfile.prod
|
|
restart: unless-stopped
|
|
stop_grace_period: 30s
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
OPENGOODS_ADDR: ":8080"
|
|
OPENGOODS_DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable"
|
|
OPENGOODS_REDIS_URL: "redis://redis:6379/0"
|
|
ports:
|
|
- "127.0.0.1:8120:8080"
|
|
|
|
admin:
|
|
build:
|
|
context: .
|
|
dockerfile: api/Dockerfile.admin
|
|
restart: unless-stopped
|
|
stop_grace_period: 30s
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
GOODS_ADMIN_ADDR: ":8080"
|
|
OPENGOODS_DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable"
|
|
GOODS_ADMIN_BASE_PATH: "/ping"
|
|
GOODS_ADMIN_USER: "${GOODS_ADMIN_USER}"
|
|
GOODS_ADMIN_PASSWORD: "${GOODS_ADMIN_PASSWORD}"
|
|
GOODS_ADMIN_JWT_SECRET: "${GOODS_ADMIN_JWT_SECRET}"
|
|
ports:
|
|
- "127.0.0.1:8121:8080"
|
|
|
|
volumes:
|
|
pgdata:
|