From 685a49cf57f64531bc7779d29650d5baffbcb796 Mon Sep 17 00:00:00 2001 From: Frank John Begornia Date: Wed, 31 Dec 2025 01:24:12 +0800 Subject: [PATCH] Remove unnecessary environment setup and optimization steps from Dockerfile --- Dockerfile | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index 198e5ed..441ad58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,40 +84,3 @@ EXPOSE 80 # Use entrypoint to set up permissions before starting Apache ENTRYPOINT ["docker-entrypoint.sh"] CMD ["apache2-foreground"] - -# Create .env file if it doesn't exist -RUN if [ ! -f .env ]; then cp .env.example .env; fi - -# Install PHP dependencies (Laravel 5.0 compatible) -RUN composer install --no-dev --no-interaction --prefer-dist - -# Generate application key -RUN php artisan key:generate || true - -# Run Laravel 5.0 optimization -RUN php artisan clear-compiled && php artisan optimize - -# Note: yakpro-po obfuscation requires PHP 7.1+, incompatible with PHP 7.0 -# For code protection with PHP 7.0, consider: -# 1. ionCube Encoder (commercial, most secure) -# 2. Keeping source code private and using proper access controls -# 3. Using --optimize flag in composer (already done above) - -# Configure Apache DocumentRoot to point to Laravel's public directory -ENV APACHE_DOCUMENT_ROOT=/var/www/html/public -RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf - -# Suppress Apache ServerName warning -RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf - -# Copy entrypoint script -COPY docker-entrypoint.sh /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-entrypoint.sh - -# Expose port 80 -EXPOSE 80 - -# Use entrypoint to set up permissions before starting Apache -ENTRYPOINT ["docker-entrypoint.sh"] -CMD ["apache2-foreground"]