68 lines
2.1 KiB
YAML
68 lines
2.1 KiB
YAML
version: '3.8'
|
||
|
||
# ============================================
|
||
# 由壹点3D素材 - 标准版配置
|
||
# 内网使用,所有资源存储在服务器本地
|
||
# 从私有镜像仓库拉取镜像,无需源码
|
||
# ============================================
|
||
|
||
services:
|
||
# PostgreSQL 数据库
|
||
postgres:
|
||
image: postgres:15-alpine
|
||
container_name: youyidian-postgres
|
||
restart: unless-stopped
|
||
environment:
|
||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-youyidian123456}
|
||
POSTGRES_DB: ${POSTGRES_DB:-youyidian3d}
|
||
POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
|
||
volumes:
|
||
- postgres_data:/var/lib/postgresql/data
|
||
networks:
|
||
- app-network
|
||
healthcheck:
|
||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
||
interval: 10s
|
||
timeout: 5s
|
||
retries: 5
|
||
|
||
# 主应用(标准版 - 从私有镜像仓库拉取)
|
||
# 所有资源存储在服务器本地,不使用MinIO
|
||
app:
|
||
image: ${DOCKER_REGISTRY:-your-registry.com}/youyidian-3d-material:standard-${IMAGE_TAG:-latest}
|
||
container_name: youyidian-3d-material
|
||
restart: unless-stopped
|
||
ports:
|
||
- "${APP_PORT:-4320}:3000"
|
||
environment:
|
||
- NODE_ENV=production
|
||
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-youyidian123456}@postgres:5432/${POSTGRES_DB:-youyidian3d}
|
||
- DATABASE_DRIVER=node
|
||
- STORAGE_PROVIDER=local
|
||
# 标准版不使用S3,所有文件存储在本地
|
||
- UPLOAD_DIR=/app/uploads
|
||
- NEXTAUTH_URL=http://${SERVER_IP:-localhost}:${APP_PORT:-4320}
|
||
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-change-this-to-a-random-string-in-production}
|
||
volumes:
|
||
- ./uploads:/app/uploads
|
||
depends_on:
|
||
postgres:
|
||
condition: service_healthy
|
||
networks:
|
||
- app-network
|
||
healthcheck:
|
||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
|
||
volumes:
|
||
postgres_data:
|
||
driver: local
|
||
|
||
networks:
|
||
app-network:
|
||
driver: bridge
|
||
|