mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2025-12-31 19:47:25 +01:00
Update dockerfile
This commit is contained in:
3
debian/Dockerfile
vendored
3
debian/Dockerfile
vendored
@@ -136,6 +136,9 @@ RUN mkdir -p \
|
||||
|
||||
RUN cp /var/www/html/resources/views/react/index.blade.php /var/www/html/public/index.html
|
||||
|
||||
# copy the public/ directory into a separate folder so that we can overwrite the volume later via the entrypoint
|
||||
RUN mkdir -p /image-original/public && cp -r /var/www/html/public /image-original/public
|
||||
|
||||
# Set permissions
|
||||
RUN chown -R www-data:www-data \
|
||||
/var/www/html/storage \
|
||||
|
||||
17
debian/scripts/init.sh
vendored
17
debian/scripts/init.sh
vendored
@@ -46,6 +46,23 @@ chmod -R 775 \
|
||||
|
||||
chown -R www-data:www-data /var/www/html/storage
|
||||
|
||||
# Ensure symlink for storage/app/public
|
||||
if [ ! -L /var/www/html/public/storage ]; then
|
||||
echo "Creating symlink for storage/app/public..."
|
||||
ln -sfn /var/www/html/storage/app/public /var/www/html/public/storage
|
||||
fi
|
||||
|
||||
# Clean the existing public/ directory but exclude .js and .css files
|
||||
if [ -d /var/www/html/public ]; then
|
||||
echo "Cleaning up stale files in public/ directory, retaining .js and .css files..."
|
||||
find /var/www/html/public -type f ! -name '*.js' ! -name '*.css' -exec rm -f {} \;
|
||||
fi
|
||||
|
||||
# Copy the public/ directory from the image to the mounted volume
|
||||
echo "Copying public/ directory from image to volume..."
|
||||
cp -r /image-original/public/* /var/www/html/public/
|
||||
|
||||
|
||||
# Clear and cache config in production
|
||||
if [ "$APP_ENV" = "production" ]; then
|
||||
gosu www-data php artisan config:cache
|
||||
|
||||
Reference in New Issue
Block a user