diff --git a/Dockerfile b/Dockerfile index ad15390..47f12e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ RUN apk add --no-cache \ oniguruma-dev \ icu-dev \ && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ - && docker-php-ext-install \ + && docker-php-ext-install -j$(nproc) \ pdo_mysql \ mbstring \ gd \ @@ -70,7 +70,9 @@ RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cac COPY docker/nginx/default.conf /etc/nginx/http.d/default.conf COPY docker/php/php.ini $PHP_INI_DIR/conf.d/app.ini COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY docker/entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh EXPOSE 80 -CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] +CMD ["/entrypoint.sh"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..f119fdf --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +echo "Running database migrations..." +php artisan migrate --force --no-interaction + +exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf