fix: 修复docker部署问题

This commit is contained in:
jianuo
2025-12-18 00:02:05 +08:00
parent 136ba4286c
commit a9912e52ca
2 changed files with 50 additions and 6 deletions

39
docker-compose.dev.yml Normal file
View File

@@ -0,0 +1,39 @@
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- DB_HOST=mysql
- DB_PORT=3306
- DB_USERNAME=pixel_game
- DB_PASSWORD=secure_password
- DB_NAME=pixel_game_db
- USE_FILE_REDIS=true
depends_on:
- mysql
restart: unless-stopped
volumes:
- ./src:/app/src
- ./logs:/app/logs
command: ["pnpm", "run", "dev"]
mysql:
image: mysql:8.0
environment:
- MYSQL_ROOT_PASSWORD=root_password
- MYSQL_DATABASE=pixel_game_db
- MYSQL_USER=pixel_game
- MYSQL_PASSWORD=secure_password
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
volumes:
mysql_data: