forked from datawhale/whale-town-end
- 添加 Dockerfile 和 docker-compose.yml 支持容器化部署 - 添加 PM2 配置文件 ecosystem.config.js - 添加部署脚本模板 deploy.sh.example - 添加 Gitea webhook 处理器模板 webhook-handler.js.example - 添加生产环境配置模板 .env.production.example - 添加详细的部署指南 DEPLOYMENT.md - 更新 .gitignore 排除敏感配置文件
36 lines
735 B
YAML
36 lines
735 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
app:
|
|
build: .
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- DB_HOST=mysql
|
|
- DB_PORT=3306
|
|
- DB_USERNAME=pixel_game
|
|
- DB_PASSWORD=your_password
|
|
- DB_NAME=pixel_game_db
|
|
depends_on:
|
|
- mysql
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
|
|
mysql:
|
|
image: mysql:8.0
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=root_password
|
|
- MYSQL_DATABASE=pixel_game_db
|
|
- MYSQL_USER=pixel_game
|
|
- MYSQL_PASSWORD=your_password
|
|
ports:
|
|
- "3306:3306"
|
|
volumes:
|
|
- mysql_data:/var/lib/mysql
|
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
mysql_data: |