Handle storage folder creation properly

This commit is contained in:
Pierre Jaury 2018-06-16 09:50:38 +02:00
parent ecd867fa30
commit 964b8e5d63
2 changed files with 8 additions and 8 deletions

View file

@ -5,7 +5,7 @@ ARG COMPOSER_CHECKSUM="67bebe9df9866a795078bb2cf21798d8b0214f2e0b2fd81f2e907a8ef
RUN apt-get update \
&& apt-get install -y --no-install-recommends libmagickwand-dev git \
&& docker-php-ext-install pdo_mysql pcntl \
&& docker-php-ext-install pdo_mysql pcntl gd \
&& pecl install imagick \
&& docker-php-ext-enable imagick pcntl imagick \
&& a2enmod rewrite \
@ -15,6 +15,8 @@ RUN apt-get update \
&& ln -sf /usr/bin/composer.phar /usr/bin/composer \
&& rm /tmp/composer.phar
ENV PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}"
COPY . /var/www/
WORKDIR /var/www/
@ -25,11 +27,11 @@ RUN install -d -m0755 -o www-data -g www-data \
/var/www/storage/framework/sessions \
/var/www/storage/framework/views \
/var/www/storage/framework/cache \
&& cp -r storage storage.skel \
&& cp docker/env .env \
&& composer install --prefer-source --no-interaction \
&& rm -rf html && ln -s public html
VOLUME ["/var/www/storage"]
ENV PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}"
CMD /var/www/docker/start.sh

View file

@ -1,8 +1,6 @@
#!/bin/sh
#!/bin/bash
mkdir -p storage/app/public/avatars
mkdir -p storage/{debugbar,logs}
mkdir -p storage/framework/{cache,sessions,views,testing}
php artisan migrate
cp -r storage.skel/* storage/
php artisan migrate --force
exec apache2-foreground