mirror of
https://github.com/patdelphi/suanming.git
synced 2026-02-28 05:33:11 +08:00
- Updated Dockerfile to use npm instead of pnpm - Added .dockerignore for optimized builds - Created docker-compose.yml for easy deployment - Added comprehensive Docker deployment guide - Configured health checks and data persistence - Ready for containerized deployment
31 lines
680 B
YAML
31 lines
680 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
suanming-app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=8000
|
|
- JWT_SECRET=${JWT_SECRET:-your-super-secret-jwt-key-change-this-in-production}
|
|
volumes:
|
|
# 持久化数据库文件
|
|
- suanming-data:/app/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
volumes:
|
|
suanming-data:
|
|
driver: local
|
|
|
|
networks:
|
|
default:
|
|
name: suanming-network |