blossom/docker/compose/blossom-mysql8.yaml
2023-11-29 19:01:08 +08:00

64 lines
2.2 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: "3.8"
networks:
blossomnet:
driver:
bridge
services:
blossom:
image: jasminexzzz/blossom:latest
container_name: blossom-backend
volumes:
# 【需修改】挂载图片保存路径如果是windows环境可以使用/c/home/bl/img/来指定磁盘
- /d/blossom/bl/:/home/bl/
environment:
# 配置数据库访问地址
SPRING_DATASOURCE_URL: jdbc:mysql://blmysql:3306/blossom?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&allowMultiQueries=true&useSSL=false&&serverTimezone=GMT%2B8
# 【需修改】配置数据库用户名
SPRING_DATASOURCE_USERNAME: root
# 【需修改】配置数据库密码
SPRING_DATASOURCE_PASSWORD: jasmine888
# 【需修改】配置图片上传后对应生成的访问 URL需要以/pic/结尾。注意,该访问域名(IP:端口)需要与访问后台的域名(IP:端口)相同
PROJECT_IAAS_BLOS_DOMAIN: http://localhost:9999/pic/
# 配置图片保存的磁盘路径,并在 volumes 中将该路径挂载为本地路径,如上方 volumes 中的示例
PROJECT_IAAS_BLOS_DEFAULT-PATH: /home/bl/img/
ports:
- "9999:9999"
networks:
- blossomnet
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9999/sys/alive"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
restart: always
depends_on:
blmysql:
condition: service_healthy
blmysql:
image: mysql:8.0.31
container_name: blossom-mysql
restart: on-failure:3
# 【需修改】注意挂载路径
volumes:
- /d/blossom/Docker/mysql/data:/var/lib/mysql
- /d/blossom/Docker/mysql/log:/var/log/mysql
- /d/blossom/Docker/mysql/mysql-files/log:/var/lib/mysql-files
environment:
MYSQL_DATABASE: blossom
# 【需修改】多数情况下与 services.blossom.environment.SPRING_DATASOURCE_PASSWORD 相同
MYSQL_ROOT_PASSWORD: jasmine888
LANG: C.UTF-8
TZ: Asia/Shanghai
ports:
- "3306:3306"
networks:
- blossomnet
healthcheck:
test: ["CMD", "mysqladmin", "-uroot", "-pjasmine888", "ping", "-h", "localhost"]
interval: 10s
timeout: 3s
retries: 12