2025-08-25 16:32:58 +08:00
|
|
|
version: '3.4'
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
new-api-custom:
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
image: new-api-custom:latest
|
|
|
|
|
container_name: new-api-custom
|
|
|
|
|
restart: always
|
|
|
|
|
command: --log-dir /app/logs
|
|
|
|
|
ports:
|
2025-08-25 16:40:09 +08:00
|
|
|
- "3099:3000"
|
2025-08-25 16:32:58 +08:00
|
|
|
volumes:
|
2025-08-25 16:40:09 +08:00
|
|
|
- ./data:/data
|
|
|
|
|
- ./logs-custom:/app/logs
|
2025-08-25 16:32:58 +08:00
|
|
|
environment:
|
2025-08-25 16:40:09 +08:00
|
|
|
- SQL_DSN=root:123456@tcp(mysql:3306)/new-api
|
|
|
|
|
- REDIS_CONN_STRING=redis://redis
|
2025-08-25 16:32:58 +08:00
|
|
|
- TZ=Asia/Shanghai
|
|
|
|
|
- ERROR_LOG_ENABLED=true
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' | awk -F: '{print $$2}'"]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 3
|
|
|
|
|
networks:
|
2025-08-25 16:40:09 +08:00
|
|
|
- new-api_default
|
2025-08-25 16:32:58 +08:00
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
new-api_default:
|
2025-08-25 16:40:09 +08:00
|
|
|
external: true
|