Files
kami/license-system-backend/docker-compose.yml
2026-01-04 23:00:21 +08:00

61 lines
1.7 KiB
YAML

version: '3.8'
services:
api:
build: .
container_name: license-api
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ConnectionStrings__DefaultConnection=Host=db;Port=5432;Database=license;Username=license;Password=${DB_PASSWORD}
- Redis__ConnectionString=redis:6379
- Redis__Enabled=${REDIS_ENABLED}
- Jwt__Secret=${JWT_SECRET}
- Jwt__Issuer=license-system
- Seed__AdminUser=${ADMIN_USER}
- Seed__AdminPassword=${ADMIN_PASSWORD}
- Seed__AdminEmail=${ADMIN_EMAIL}
- Cors__AllowAny=${CORS_ALLOW_ANY}
- Cors__AllowedOrigins__0=${CORS_ALLOWED_ORIGIN0}
- Storage__ClientRsaPublicKeyPem=${STORAGE_CLIENT_RSA_PUBLIC_KEY_PEM}
- Storage__RequireHttpsForDownloadKey=${STORAGE_REQUIRE_HTTPS_FOR_DOWNLOAD_KEY}
volumes:
- ./data/uploads:/app/uploads
- ./data/logs:/app/logs
- ./data/protection-keys:/app/data/protection-keys
ports:
- "0.0.0.0:39256:39256"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
db:
image: postgres:16-alpine
container_name: license-db
restart: always
environment:
POSTGRES_DB: license
POSTGRES_USER: license
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- ./data/postgres:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U license"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: license-redis
restart: always
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
volumes:
- ./data/redis:/data
ports:
- "127.0.0.1:6379:6379"