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>
52 lines
1.3 KiB
Docker
52 lines
1.3 KiB
Docker
FROM php:8.1-apache
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libpng-dev \
|
|
libjpeg-dev \
|
|
libfreetype6-dev \
|
|
libonig-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install PHP extensions needed by videoDB
|
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install -j$(nproc) \
|
|
gd \
|
|
mysqli \
|
|
exif \
|
|
mbstring
|
|
|
|
# Enable Apache mod_rewrite for .htaccess
|
|
RUN a2enmod rewrite
|
|
|
|
# Allow .htaccess overrides in document root
|
|
RUN sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
|
|
|
|
# Set working directory to document root
|
|
WORKDIR /var/www/html
|
|
|
|
# Copy application (including vendor which is committed to the repo)
|
|
COPY . .
|
|
|
|
# Create cache directories and set permissions
|
|
RUN mkdir -p \
|
|
cache/smarty \
|
|
cache/imdb \
|
|
cache/img \
|
|
cache/thumbs \
|
|
cache/javascript \
|
|
cache/local \
|
|
&& chown -R www-data:www-data \
|
|
cache \
|
|
images
|
|
|
|
# Copy entrypoint and db-init scripts
|
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
COPY init-db.php /usr/local/bin/init-db.php
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
EXPOSE 80
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
CMD ["apache2-foreground"]
|