feat: PM2 + Docker deployment config (MySQL container, PM2 for backend+frontend proxy)

This commit is contained in:
2026-07-06 10:12:05 +08:00
parent a568da160c
commit 2ce73b8fc3
7 changed files with 217 additions and 37 deletions

View File

@@ -3,48 +3,18 @@ version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: dorm_billing_mysql
container_name: gongxue_mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: dorm_billing_2024
MYSQL_DATABASE: dorm_billing
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-gongxue_2024}
MYSQL_DATABASE: ${DB_DATABASE:-gongxue}
MYSQL_CHARSET: utf8mb4
MYSQL_COLLATION: utf8mb4_unicode_ci
ports:
- "3306:3306"
- "127.0.0.1:3306:3306"
volumes:
- mysql_data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
backend:
build:
context: .
dockerfile: apps/server/Dockerfile
container_name: dorm_billing_backend
restart: always
ports:
- "3000:3000"
environment:
DB_HOST: mysql
DB_PORT: 3306
DB_USERNAME: root
DB_PASSWORD: dorm_billing_2024
DB_DATABASE: dorm_billing
JWT_SECRET: dorm-billing-jwt-secret-key-2024
JWT_EXPIRES_IN: 24h
depends_on:
- mysql
frontend:
build:
context: .
dockerfile: apps/admin/Dockerfile
container_name: dorm_billing_frontend
restart: always
ports:
- "80:80"
depends_on:
- backend
volumes:
mysql_data: