Spaces:
Sleeping
Sleeping
| FROM php:8.2-apache | |
| # Install MySQL and PHP extensions | |
| RUN apt-get update && apt-get install -y \ | |
| default-mysql-server \ | |
| default-mysql-client \ | |
| && docker-php-ext-install pdo pdo_mysql mysqli \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /var/www/html | |
| # Copy project files | |
| COPY . /var/www/html/ | |
| # Set permissions | |
| RUN chown -R www-data:www-data /var/www/html \ | |
| && chmod -R 755 /var/www/html | |
| # Change Apache port to 7860 (required by HF Spaces) | |
| RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf \ | |
| && sed -i 's/80/7860/g' /etc/apache2/sites-available/000-default.conf | |
| # Enable Apache rewrite module | |
| RUN a2enmod rewrite | |
| # Copy and set up entrypoint script | |
| COPY docker-entrypoint.sh /usr/local/bin/ | |
| RUN chmod +x /usr/local/bin/docker-entrypoint.sh | |
| # Expose port 7860 | |
| EXPOSE 7860 | |
| # Set entrypoint | |
| ENTRYPOINT ["docker-entrypoint.sh"] | |