File size: 952 Bytes
75565db |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
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"]
|