CaiWuXiTong/docker-compose.local.yml

81 lines
2.4 KiB
YAML
Raw 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.

# 本地开发/测试用 Compose 文件
# - app 通过 runtime/.env 读取当前系统数据库配置
# - mysql 只用于首次登录和填写“系统数据库”前的临时引导
# - 保存系统数据库后,用户、设置和云数据库登记都来自共享系统数据库
#
# 首次启动:bash deploy/local-init.sh --build
# 停止: docker compose -f docker-compose.local.yml down
# 日志: docker compose -f docker-compose.local.yml logs -f app
#
# 不要把生产 APP_KEY、其他开发者的 .env 或云数据库密码复制到本机。
services:
app:
build:
context: .
dockerfile: deploy/Dockerfile.local
image: jiangling_akaunting:local
container_name: jiangling_app
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
ports:
- "127.0.0.1:18088:18088"
volumes:
- ./runtime/.env:/var/www/html/.env
- jiangling_storage:/var/www/html/storage
- ./app:/var/www/html/app
- ./config:/var/www/html/config
- ./database:/var/www/html/database
- ./modules:/var/www/html/modules
- ./resources:/var/www/html/resources
- ./routes:/var/www/html/routes
- ./tests:/var/www/html/tests
networks:
- jiangling_net
healthcheck:
test: ["CMD", "php", "artisan", "app:ready", "--quiet"]
interval: 15s
timeout: 5s
retries: 10
start_period: 60s
mysql:
image: mysql:8.0
container_name: jiangling_mysql
restart: unless-stopped
# 这些凭据只属于回环地址上的临时引导库,不是团队共享数据库凭据。
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: akaunting
MYSQL_USER: akaunting
MYSQL_PASSWORD: akaunting123
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-authentication-plugin=mysql_native_password
volumes:
- jiangling_mysql:/var/lib/mysql
ports:
- "127.0.0.1:13306:3306"
networks:
- jiangling_net
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "root", "-p$$MYSQL_ROOT_PASSWORD"]
interval: 5s
timeout: 5s
retries: 20
start_period: 30s
volumes:
jiangling_storage:
name: jiangling_storage
jiangling_mysql:
name: jiangling_mysql
networks:
jiangling_net:
name: jiangling_net
driver: bridge