This commit is contained in:
18631081161 2026-03-02 23:42:00 +08:00
commit e686cdc0fc
2 changed files with 9 additions and 30 deletions

View File

@ -1,43 +1,22 @@
version: '3.8' version: '3.8'
services: services:
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: jewelry123
MYSQL_DATABASE: jewelry_mall
MYSQL_CHARACTER_SET_SERVER: utf8mb4
MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./server/migrations/001_init.sql:/docker-entrypoint-initdb.d/001_init.sql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 10
server: server:
build: ./server build: ./server
ports: ports:
- "3000:3000" - "3000:3000"
environment: environment:
DB_HOST: mysql DB_HOST: ${DB_HOST:-192.168.195.15}
DB_PORT: 3306 DB_PORT: ${DB_PORT:-3306}
DB_USER: root DB_USER: ${DB_USER:-root}
DB_PASSWORD: jewelry123 DB_PASSWORD: ${DB_PASSWORD:-root123456}
DB_NAME: jewelry_mall DB_NAME: ${DB_NAME:-jewelry_mall}
WX_APPID: wx58b02b73d9c26c10 WX_APPID: ${WX_APPID:-wx58b02b73d9c26c10}
WX_SECRET: 3b6cdaffa9ef92d877f79ebd739b47b0 WX_SECRET: ${WX_SECRET:-3b6cdaffa9ef92d877f79ebd739b47b0}
JWT_SECRET: jewelry-mall-jwt-secret JWT_SECRET: ${JWT_SECRET:-jewelry-mall-jwt-secret}
PORT: 3000 PORT: 3000
volumes: volumes:
- server_uploads:/app/uploads - server_uploads:/app/uploads
depends_on:
mysql:
condition: service_healthy
admin: admin:
build: ./admin build: ./admin
@ -47,5 +26,4 @@ services:
- server - server
volumes: volumes:
mysql_data:
server_uploads: server_uploads:

View File

@ -3,3 +3,4 @@ dist
tests tests
*.test.ts *.test.ts
vitest.config.ts vitest.config.ts
.env