FROM php:8.2-fpm-alpine # Install system dependencies RUN apk add --no-cache \ nginx \ supervisor \ sqlite-dev \ libzip-dev \ zip \ unzip # Install PHP extensions RUN docker-php-ext-install pdo_sqlite zip # Configure Nginx COPY docker/nginx.conf /etc/nginx/http.d/default.conf # Configure Supervisor COPY docker/supervisord.conf /etc/supervisord.conf # Set working directory WORKDIR /var/www/html # Copy application files COPY . /var/www/html # Create Database directory explicitly & Set Permissions RUN mkdir -p /var/www/html/app/Database && \ chown -R www-data:www-data /var/www/html && \ chmod -R 755 /var/www/html # Copy Entrypoint COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh # Expose port EXPOSE 80 # Use Entrypoint ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] # Start Supervisor CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]