dev #1
@@ -69,8 +69,13 @@ RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf
|
|||||||
# Suppress Apache ServerName warning
|
# Suppress Apache ServerName warning
|
||||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
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 port 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Start Apache
|
# Use entrypoint to set up permissions before starting Apache
|
||||||
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
CMD ["apache2-foreground"]
|
CMD ["apache2-foreground"]
|
||||||
17
docker-entrypoint.sh
Normal file
17
docker-entrypoint.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Create storage directory structure if it doesn't exist
|
||||||
|
mkdir -p storage/framework/views
|
||||||
|
mkdir -p storage/framework/cache
|
||||||
|
mkdir -p storage/framework/sessions
|
||||||
|
mkdir -p storage/logs
|
||||||
|
mkdir -p storage/app/public
|
||||||
|
mkdir -p bootstrap/cache
|
||||||
|
|
||||||
|
# Set proper permissions
|
||||||
|
chown -R www-data:www-data storage bootstrap/cache
|
||||||
|
chmod -R 775 storage bootstrap/cache
|
||||||
|
|
||||||
|
# Execute the main command
|
||||||
|
exec "$@"
|
||||||
Reference in New Issue
Block a user