This commit is contained in:
parent
fec5542019
commit
166d4987c6
20
Dockerfile
20
Dockerfile
@ -25,16 +25,20 @@ WORKDIR /var/www
|
|||||||
COPY . .
|
COPY . .
|
||||||
COPY .env.example .env
|
COPY .env.example .env
|
||||||
|
|
||||||
# Install dependencies
|
# Set www-data user permission before running composer/install artisan
|
||||||
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
RUN chown -R www-data:www-data /var/www
|
||||||
|
|
||||||
# Generate app key
|
USER www-data
|
||||||
RUN php artisan key:generate
|
|
||||||
|
|
||||||
# Set permissions
|
# Install dependencies & generate app key as www-data user
|
||||||
RUN chown -R www-data:www-data /var/www \
|
RUN composer install --no-interaction --prefer-dist --optimize-autoloader \
|
||||||
&& chmod -R 775 storage bootstrap/cache \
|
&& php artisan key:generate
|
||||||
&& chown -R www-data:www-data storage bootstrap/cache
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# Set permissions again just in case
|
||||||
|
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache \
|
||||||
|
&& chmod -R 775 /var/www/storage /var/www/bootstrap/cache
|
||||||
|
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
||||||
Loading…
x
Reference in New Issue
Block a user