Files
ip-manager/Dockerfile
2026-01-16 19:48:04 +00:00

38 lines
982 B
Docker

FROM php:8.3-apache
# Install PHP extensions for MySQL/MariaDB
RUN docker-php-ext-install pdo pdo_mysql mysqli
# Enable Apache modules
RUN a2enmod rewrite headers
# Configure Apache
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
# Set working directory
WORKDIR /var/www/html
# Configure PHP for production
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Custom PHP settings
RUN echo "expose_php = Off" >> "$PHP_INI_DIR/conf.d/custom.ini" && \
echo "display_errors = Off" >> "$PHP_INI_DIR/conf.d/custom.ini" && \
echo "log_errors = On" >> "$PHP_INI_DIR/conf.d/custom.ini" && \
echo "error_log = /var/log/php_errors.log" >> "$PHP_INI_DIR/conf.d/custom.ini"
# Copy application files
COPY webapp/ /var/www/html/
# Copy database scripts for potential import use
COPY database/ /opt/geofeed/database/
# Set permissions
RUN chown -R www-data:www-data /var/www/html
# Expose port 80
EXPOSE 80
# Start Apache
CMD ["apache2-foreground"]