feat(docker): optimize copy command to modify perms

The previous chown command is no longer needed, resulting in significant time savings.
This commit is contained in:
Miguel Nogueira 2024-04-08 03:03:30 +01:00
parent f8e0ef5cfa
commit aee7e505bc
No known key found for this signature in database
GPG Key ID: 43EF15DB0CC86DDD

View File

@ -19,13 +19,12 @@ RUN apt-get install -y nodejs
WORKDIR /var/www/html
COPY . .
COPY --chown=www-data:www-data . .
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer update && composer install
RUN npm ci
# Set Laravel's permissions and setup storage, though this could be done in the COPY command directly
RUN chown -R www-data:www-data .
RUN chmod -R 755 /var/www/html/storage
RUN php artisan storage:link