35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
version: '3.8'
|
|
|
|
services:
|
|
# 即梦 API 服务
|
|
jimeng-free-api:
|
|
build:
|
|
context: ./
|
|
dockerfile: Dockerfile
|
|
image: jimeng-free-api:latest
|
|
container_name: jimeng-free-api
|
|
restart: unless-stopped
|
|
environment:
|
|
- NODE_ENV=production
|
|
- SERVICE_ID=${SERVICE_ID:-jimeng-free-api}
|
|
- INSTANCE_ID=${INSTANCE_ID:-instance-1}
|
|
- SERVICE_NAME=${SERVICE_NAME:-jimeng-free-api}
|
|
- MONGODB_URL=${MONGODB_URL:-mongodb://localhost:27017/jimeng-api}
|
|
- TOS_ACCESS_KEY_ID=${TOS_ACCESS_KEY_ID}
|
|
- TOS_ACCESS_KEY_SECRET=${TOS_ACCESS_KEY_SECRET}
|
|
- TOS_BUCKET_NAME=${TOS_BUCKET_NAME}
|
|
- TOS_SELF_DOMAIN=${TOS_SELF_DOMAIN}
|
|
- TOS_REGION=${TOS_REGION:-cn-beijing}
|
|
- TOS_ENDPOINT=${TOS_ENDPOINT:-tos-cn-beijing.volces.com}
|
|
- HEARTBEAT_ENABLED=${HEARTBEAT_ENABLED:-true}
|
|
- HEARTBEAT_INTERVAL=${HEARTBEAT_INTERVAL:-30}
|
|
ports:
|
|
- "${API_PORT:-3302}:3302"
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3302/ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s |