Skip to content

Commit

Permalink
fix: move storage:link to dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hackeresq committed Jan 31, 2025
1 parent 1195fac commit 00a1312
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
10 changes: 4 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Set permissions and ensure www-data has a shell available
RUN chown -R www-data:www-data . \
&& chmod -R 775 ./storage \
&& chmod +x ./docker/entrypoint.sh

# && usermod -s /bin/bash www-data
# Set permissions and link storage
RUN php artisan storage:link \
&& chown -R www-data:www-data . \
&& chmod +x ./docker/entrypoint.sh

# Serve on port 80
EXPOSE 80
Expand Down
9 changes: 0 additions & 9 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ chown -R www-data:www-data storage

echo -e "\n > Storage directory scaffolding is OK... "

# Ensure storage symlink exists
if [[ ! -L "public/storage" ]]; then
echo -e "\n > Creating symbolic link for app public storage... "

php artisan storage:link
else
echo -e "\n > Storage linked... "
fi

# Ensure app key is generated
if [[ -z "$APP_KEY" ]]; then
echo -e "\n > Oops! The required APP_KEY configuration is missing in your environment! "
Expand Down

0 comments on commit 00a1312

Please sign in to comment.