Remove unnecessary environment setup and optimization steps from Dockerfile
All checks were successful
Deploy Production (crewsportswear.com) / deploy (push) Successful in 2m13s
All checks were successful
Deploy Production (crewsportswear.com) / deploy (push) Successful in 2m13s
This commit is contained in:
37
Dockerfile
37
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"]
|
||||
|
||||
Reference in New Issue
Block a user