You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lingshu/docker-compose.db-only.yml

27 lines
727 B

version: '3.8'
services:
db:
image: mysql:8.0
container_name: lingshu_db
restart: always
environment:
MYSQL_ROOT_PASSWORD: lingshu123
MYSQL_DATABASE: lingshu
MYSQL_CHARSET: utf8mb4
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --init-connect='SET NAMES utf8mb4'
volumes:
- db_data:/var/lib/mysql
- ./灵枢数据库设计.sql:/docker-entrypoint-initdb.d/01_schema.sql
- ./init_demo_data.sql:/docker-entrypoint-initdb.d/02_data.sql
ports:
- "3307:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-plingshu123"]
interval: 5s
timeout: 5s
retries: 10
volumes:
db_data: