FROM php:8.3-apache ARG UNAME=www-data ARG UGROUP=www-data ARG UID=1000 ARG GID=1001 RUN usermod --uid $UID $UNAME RUN groupmod --gid $GID $UGROUP # Install required extensions RUN apt-get update && apt-get install -y \ git \ curl \ libcurl4-openssl-dev \ && docker-php-ext-install curl \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /var/www/html # Copy application files COPY . /var/www/html/ # Set permissions RUN chown -R www-data:www-data /var/www/html \ && chmod -R 755 /var/www/html # Enable Apache rewrite module RUN a2enmod rewrite # Create uploads directory RUN mkdir -p /var/www/html/uploads && chown www-data:www-data /var/www/html/uploads # Expose port EXPOSE 7860 # Configure Apache to use port 7860 (Hugging Face standard) RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf RUN sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf CMD ["apache2-foreground"]