The MariaDB CLI client (default-mysql-client on Debian) cannot complete the caching_sha2_password handshake used by MySQL 8.0, so the entrypoint wait loop never exited. - Dockerfile: remove default-mysql-client (no longer needed) - docker-entrypoint.sh: wait loop now uses a PHP one-liner via mysqli_connect (same mysqlnd driver the app uses — if it connects, the app will too) - docker-compose.yml: health check pings via local socket without credentials (mysqladmin ping -h localhost --silent works inside the DB container) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
services:
|
|
|
|
app:
|
|
build:
|
|
context: ./videodb
|
|
container_name: videodb_app
|
|
ports:
|
|
- "6761:80"
|
|
environment:
|
|
DB_HOST: db
|
|
DB_USER: videodb
|
|
DB_PASSWORD: videodb_secret
|
|
DB_NAME: videodb
|
|
DB_PREFIX: videodb_
|
|
INGEST_API_TOKEN: change_this_secret_token
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
# Persist cover images and cached thumbnails across rebuilds
|
|
- videodb_cache:/var/www/html/cache
|
|
- videodb_images:/var/www/html/images
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: mysql:8.0
|
|
container_name: videodb_db
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: root_secret
|
|
MYSQL_DATABASE: videodb
|
|
MYSQL_USER: videodb
|
|
MYSQL_PASSWORD: videodb_secret
|
|
volumes:
|
|
- videodb_db:/var/lib/mysql
|
|
# MySQL 8 defaults to caching_sha2_password; keep native auth for broad client compat
|
|
command: --default-authentication-plugin=mysql_native_password
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "--silent"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 12
|
|
start_period: 30s
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
videodb_db:
|
|
videodb_cache:
|
|
videodb_images:
|