Files
Axia4/Dockerfile
2026-01-25 20:17:21 +00:00

44 lines
1.0 KiB
Docker

# Use official PHP image with Apache
FROM php:8.2-apache
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
zip \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Configure PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
# Enable Apache modules
RUN a2enmod rewrite
# Set working directory
WORKDIR /var/www/html
# Copy application files
COPY public_html/ /var/www/html/
# Create DATA directory with proper permissions
RUN mkdir -p /DATA && \
chown -R www-data:www-data /DATA && \
chmod -R 755 /DATA
# Set permissions for web directory
RUN chown -R www-data:www-data /var/www/html && \
chmod -R 755 /var/www/html
# Configure PHP settings
RUN echo "session.cookie_lifetime = 604800" >> /usr/local/etc/php/conf.d/custom.ini && \
echo "session.gc_maxlifetime = 604800" >> /usr/local/etc/php/conf.d/custom.ini
# Expose port 80
EXPOSE 80
# Start Apache
CMD ["apache2-foreground"]