From 3d993086ada3f8e01f989d125fb24002e9119e1b Mon Sep 17 00:00:00 2001 From: Seth Phat Date: Tue, 6 Feb 2024 13:25:16 +0000 Subject: [PATCH] wip --- .docker/Dockerfile | 1 + .docker/entrypoint.sh | 9 ++------- .docker/scripts/caches.sh | 14 +++++++++++--- .docker/scripts/migrate.sh | 4 +++- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index ded4ff9..055f326 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -23,6 +23,7 @@ COPY ./.docker/docking-worker.conf /etc/supervisor/conf.d/ COPY ./.docker/docking-host.conf /etc/nginx/conf.d/default.conf RUN cp .docker/entrypoint.sh /entrypoint +RUN chmod +x /entrypoint # The bundle already built, no need to keep this to save size RUN rm -rf ./node_modules diff --git a/.docker/entrypoint.sh b/.docker/entrypoint.sh index 40eace6..0655454 100755 --- a/.docker/entrypoint.sh +++ b/.docker/entrypoint.sh @@ -5,11 +5,6 @@ for f in /var/www/html/.docker/scripts/*.sh; do # Bail out this loop if any script exits with non-zero status code bash "$f" || break done -chown -R www-data:www-data /var/www/html -if [ $# -gt 0 ]; then - # If we passed a command, run it as root - exec "$@" -else - exec /usr/bin/supervisord -n -fi +echo "Starting the application using supervisor..."; +exec /usr/bin/supervisord --nodaemon \ No newline at end of file diff --git a/.docker/scripts/caches.sh b/.docker/scripts/caches.sh index 7ab868a..fe31d01 100755 --- a/.docker/scripts/caches.sh +++ b/.docker/scripts/caches.sh @@ -1,5 +1,13 @@ #!/usr/bin/env bash -/usr/bin/php /var/www/html/artisan config:cache --no-ansi -q -/usr/bin/php /var/www/html/artisan route:cache --no-ansi -q -/usr/bin/php /var/www/html/artisan view:cache --no-ansi -q +echo "Running config:cache..."; +php /var/www/html/artisan config:cache --no-ansi -q +echo "Successfully cached the configuration"; + +echo "Running route:cache..."; +php /var/www/html/artisan route:cache --no-ansi -q +echo "Successfully cached the routes"; + +echo "Running view:cache..."; +php /var/www/html/artisan view:cache --no-ansi -q +echo "Successfully cached the views"; diff --git a/.docker/scripts/migrate.sh b/.docker/scripts/migrate.sh index 0daaa86..0f463f3 100755 --- a/.docker/scripts/migrate.sh +++ b/.docker/scripts/migrate.sh @@ -1,3 +1,5 @@ #!/usr/bin/env bash -/usr/bin/php /var/www/html/artisan migrate --force +echo "Running migration..."; +php /var/www/html/artisan migrate --no-ansi -q --force +echo "Successfully migrated";