version: '3.8' services: usdt-shop: build: . ports: - "3001:3000" environment: - NODE_ENV=production - PORT=3000 - DB_PATH=/data/database/shop.db volumes: # 持久化数据库文件到专用目录 - ./database:/data/database:rw # 持久化上传的图片(如果有) - ./public/images:/app/public/images:rw restart: unless-stopped healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000"] timeout: 5s interval: 30s retries: 3 start_period: 40s # Nginx反向代理(可选) nginx: image: nginx:alpine ports: - "80:80" - "443:443" volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - ./ssl:/etc/nginx/ssl:ro depends_on: - usdt-shop restart: unless-stopped profiles: - nginx networks: default: driver: bridge volumes: database: driver: local