From a900f58c26e88a9544632fdca3e68d7ff107e992 Mon Sep 17 00:00:00 2001 From: PeterChrz Date: Wed, 1 Apr 2026 00:26:39 -0400 Subject: [PATCH] feat: add entrypoint script to run migrations on startup Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 4 +++- docker/entrypoint.sh | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 docker/entrypoint.sh diff --git a/Dockerfile b/Dockerfile index fa58159..fa4e2c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,6 +65,8 @@ COPY --from=node-builder /app/public/build /var/www/html/public/build COPY docker/nginx.conf /etc/nginx/nginx.conf COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY docker/php.ini /usr/local/etc/php/conf.d/app.ini +COPY docker/entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh # Set up storage and cache directories RUN mkdir -p \ @@ -82,4 +84,4 @@ RUN rm -f .env .env.* 2>/dev/null || true EXPOSE 80 -CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..0a5c9d1 --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +php artisan migrate --force + +exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf