diff --git a/contrib/docker/Dockerfile.apache b/contrib/docker/Dockerfile.apache
index 481db4647..1b59ce9d2 100644
--- a/contrib/docker/Dockerfile.apache
+++ b/contrib/docker/Dockerfile.apache
@@ -4,7 +4,7 @@ ARG COMPOSER_VERSION="1.6.5"
 ARG COMPOSER_CHECKSUM="67bebe9df9866a795078bb2cf21798d8b0214f2e0b2fd81f2e907a8ef0be3434"
 
 RUN apt-get update \
- && apt-get install -y --no-install-recommends git \
+ && apt-get install -y --no-install-recommends git gosu \
       optipng pngquant jpegoptim gifsicle \
       libfreetype6 libjpeg62-turbo libpng16-16 libxpm4 libvpx4 libmagickwand-6.q16-3 \
       libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libvpx-dev libmagickwand-dev \
diff --git a/contrib/docker/start.sh b/contrib/docker/start.sh
index 1367b8635..6f99cb449 100755
--- a/contrib/docker/start.sh
+++ b/contrib/docker/start.sh
@@ -2,18 +2,18 @@
 
 # Create the storage tree if needed and fix permissions
 cp -r storage.skel/* storage/
-chown -R www-data:www-data storage/
+chown -R www-data:www-data storage/ bootstrap/cache/
 php artisan storage:link
 
 # Migrate database if the app was upgraded
-php artisan migrate --force
+gosu www-data:www-data php artisan migrate --force
 
 # Run other specific migratins if required
-php artisan update
+gosu www-data:www-data php artisan update
 
 # Run a worker if it is set as embedded
 if [ $HORIZON_EMBED = true ]; then
-	php artisan horizon &
+  gosu www-data:www-data php artisan horizon &
 fi
 
 # Finally run Apache
diff --git a/docker-compose.yml b/docker-compose.yml
index 4c6e8f6db..a010930a4 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -38,7 +38,7 @@ services:
   #     - "app-storage:/var/www/storage"
   #   networks:
   #     - internal
-  #   command: php artisan horizon
+  #   command: gosu www-data php artisan horizon
     
   db:
     image: mysql:5.7