diff --git a/Dockerfile b/Dockerfile index 41276bef..fe209b52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN apk add php8-zip \ php8-fileinfo \ php8-simplexml php8-xml php8-xmlreader php8-xmlwriter \ php8-tokenizer - + RUN apk update && \ apk add --no-cache \ libzip-dev \ @@ -45,23 +45,19 @@ RUN curl -sS https://getcomposer.org/installer | php \ COPY . /var/www/mercator WORKDIR /var/www/mercator -# the sqlite file must exist -# RUN touch ${DB_DATABASE} - # add mercator:www user RUN addgroup --g 1000 -S www && \ adduser -u 1000 -S mercator -G www && \ chown -R mercator:www /var/www /var/lib/nginx /var/log/nginx /etc/nginx/http.d # COPY nginx.conf /etc/nginx/http.d/mercator.conf -# RUN chown -R mercator:www +# RUN chown -R mercator:www RUN cp docker/nginx.conf /etc/nginx/http.d/default.conf RUN cp docker/supervisord.conf /etc/supervisord.conf RUN chown -R mercator:www /etc/nginx/http.d/default.conf RUN chown -R mercator:www /etc/supervisord.conf - USER mercator:www # Install mercator deps @@ -69,6 +65,12 @@ RUN set -ex ; \ composer -n validate --strict ; \ composer -n install --no-scripts --ignore-platform-reqs --no-dev +# Publish Laravel Vendor resources +RUN php artisan vendor:publish --all + +# Install passport +RUN php artisan passport:install + EXPOSE 8000 CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"] diff --git a/docker/supervisord.conf b/docker/supervisord.conf index 49768db5..e358fa6b 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -3,12 +3,11 @@ nodaemon=true [program:migrate] command=/bin/sh -c ' - php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider" if [ ! -s ${DB_DATABASE} ]; then touch ${DB_DATABASE} && chmod a+x ${DB_DATABASE} && (php artisan migrate --force) && - (php artisan db:seed --force && php artisan passport:install); + (php artisan db:seed --force); else php artisan migrate; fi;