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