ishop/docker-compose.yml
2025-08-10 13:01:33 +08:00

46 lines
969 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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