JewelryMall/docker-compose.yml
2026-02-21 16:18:01 +08:00

52 lines
1.1 KiB
YAML

version: '3.8'
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:
build: ./server
ports:
- "3000:3000"
environment:
DB_HOST: mysql
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: jewelry123
DB_NAME: jewelry_mall
WX_APPID: wx58b02b73d9c26c10
WX_SECRET: 3b6cdaffa9ef92d877f79ebd739b47b0
JWT_SECRET: jewelry-mall-jwt-secret
PORT: 3000
volumes:
- server_uploads:/app/uploads
depends_on:
mysql:
condition: service_healthy
admin:
build: ./admin
ports:
- "8080:80"
depends_on:
- server
volumes:
mysql_data:
server_uploads: