Files
MeDBia/videodb/Dockerfile
Malin f55c91276e feat: add videodb media index with Docker stack
- Add videodb PHP/MySQL media collection manager (Blu-ray, DVD, CD)
- Dockerfile: PHP 8.1 + Apache with GD/mysqli/exif extensions
- docker-compose.yml: app on port 6761 + MySQL 8.0 with health checks
- docker-entrypoint.sh: auto-generates config.inc.php from env vars,
  waits for MySQL, initializes DB schema idempotently
- init-db.php: CLI schema installer using app's own prefix_query() logic
- Persistent volumes for DB, cache, and cover images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 09:49:52 +02:00

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 \
default-mysql-client \
&& 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"]