- Rename containers with yxai suffix to avoid conflicts - Use local Dockerfile build instead of prebuilt image - Map port 3031:3000 - Simplify configuration for production use Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
44 lines
924 B
YAML
44 lines
924 B
YAML
version: '3.4'
|
|
|
|
services:
|
|
new-api-yxai:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: new-api-yxai
|
|
restart: always
|
|
command: --log-dir /app/logs
|
|
ports:
|
|
- "3031:3000"
|
|
volumes:
|
|
- ./data:/data
|
|
- ./logs:/app/logs
|
|
environment:
|
|
- SQL_DSN=postgresql://root:123456@postgres-yxai:5432/new-api
|
|
- REDIS_CONN_STRING=redis://redis-yxai
|
|
- TZ=Asia/Shanghai
|
|
- ERROR_LOG_ENABLED=true
|
|
- BATCH_UPDATE_ENABLED=true
|
|
depends_on:
|
|
- redis-yxai
|
|
- postgres-yxai
|
|
|
|
redis-yxai:
|
|
image: redis:latest
|
|
container_name: redis-yxai
|
|
restart: always
|
|
|
|
postgres-yxai:
|
|
image: postgres:15
|
|
container_name: postgres-yxai
|
|
restart: always
|
|
environment:
|
|
POSTGRES_USER: root
|
|
POSTGRES_PASSWORD: 123456
|
|
POSTGRES_DB: new-api
|
|
volumes:
|
|
- pg_yxai_data:/var/lib/postgresql/data
|
|
|
|
volumes:
|
|
pg_yxai_data:
|