Files
student_manger/docker-compose.yml

26 lines
520 B
YAML

version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: student-app
ports:
- "3000:3000"
volumes:
# 持久化数据库文件
- student-data:/app/data
environment:
- DATABASE_URL=file:/app/data/student.db
- NODE_ENV=production
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
volumes:
student-data: