version: '3.8' services: # 主应用服务 rust-user-api: build: context: . dockerfile: Dockerfile container_name: rust-user-api ports: - "3000:3000" environment: - RUST_LOG=info - DATABASE_URL=sqlite:///app/data/users.db?mode=rwc - SERVER_HOST=0.0.0.0 - SERVER_PORT=3000 - LOG_LEVEL=info - LOG_FORMAT=pretty - LOG_TO_CONSOLE=true - LOG_TO_FILE=false volumes: - api_data:/app/data restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s volumes: api_data: driver: local