Dockerfile now copies and sets up script.sh as startup.sh. Dockerfile-db adds a custom healthcheck script using mariadb-admin. docker-compose.yml updates service commands, healthcheck configuration, and dependency conditions. script.sh improves database readiness logic. Minor fix in migration file to remove BOM character.
39 行
642 B
YAML
39 行
642 B
YAML
networks:
|
|
mynet:
|
|
|
|
services:
|
|
web:
|
|
build: .
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "80:80"
|
|
volumes:
|
|
- ./:/var/www/html:rw
|
|
command: ["/usr/local/bin/startup.sh"]
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
networks:
|
|
- mynet
|
|
restart: on-failure
|
|
|
|
db:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile-db
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- db_data:/var/lib/mysql
|
|
networks:
|
|
- mynet
|
|
healthcheck:
|
|
test: ["CMD", "/usr/local/bin/healthcheck.sh"]
|
|
timeout: 20s
|
|
retries: 10
|
|
interval: 10s
|
|
start_period: 40s
|
|
|
|
volumes:
|
|
db_data: {}
|