6b3719bf28
MySQL first-boot InnoDB init + schema.sql takes ~6 minutes. Previous config only allowed 130s total (30s start_period + 20x5s), causing container to be marked unhealthy before MySQL was ready. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
expose:
|
|
- "80"
|
|
environment:
|
|
DB_HOST: "${DB_HOST:-db}"
|
|
DB_NAME: "${DB_NAME:-webgis_jalan}"
|
|
DB_USER: "${DB_USER:-webgis}"
|
|
DB_PASS: "${DB_PASS:?Set DB_PASS in Coolify}"
|
|
volumes:
|
|
- uploads-data:/var/www/html/uploads
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1/ >/dev/null || exit 1"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
db:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.db
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_DATABASE: "${DB_NAME:-webgis_jalan}"
|
|
MYSQL_USER: "${DB_USER:-webgis}"
|
|
MYSQL_PASSWORD: "${DB_PASS:?Set DB_PASS in Coolify}"
|
|
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD:?Set DB_ROOT_PASSWORD in Coolify}"
|
|
volumes:
|
|
- mysql-data:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "mysqladmin ping -h localhost -uroot -p\"$${MYSQL_ROOT_PASSWORD}\" --silent"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 30
|
|
start_period: 360s
|
|
|
|
volumes:
|
|
mysql-data:
|
|
uploads-data:
|