diff --git a/.dockerignore b/.dockerignore index a057373363..2f9e9ea9b8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ **.DS_Store +.env .devcontainer .dockerignore .editorconfig diff --git a/Dockerfile b/Dockerfile index 534473e9b2..132991a641 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,22 +73,22 @@ WORKDIR /var/www/html RUN apk update && apk add --no-cache \ caddy ca-certificates supervisor supercronic -COPY Caddyfile /etc/caddy/Caddyfile COPY --from=composerbuild /build . COPY --from=yarnbuild /build/public ./public -# Set permissions for Laravel directories +# Set permissions for Laravel/Caddy/Supervisord directories RUN mkdir -p /pelican-data /var/run/supervisord /etc/supercronic \ && chmod -R 755 /pelican-data storage bootstrap/cache /var/run/supervisord \ && chown -R www-data:www-data /pelican-data storage bootstrap/cache /var/run/supervisord \ # Only database folder permissions are needed to link to sqlite database, no deeper && chmod 755 database \ - && chown www-data:www-data database \ - # Add Laravel scheduler to crontab - && echo "* * * * * php /var/www/html/artisan schedule:run" > /etc/supercronic/crontab + && chown www-data:www-data database # Configure Supervisor COPY docker/supervisord.conf /etc/supervisord.conf +COPY docker/Caddyfile /etc/caddy/Caddyfile +# Add Laravel scheduler to crontab +COPY docker/crontab /etc/supercronic/crontab COPY docker/entrypoint.sh ./docker/entrypoint.sh diff --git a/Caddyfile b/docker/Caddyfile similarity index 100% rename from Caddyfile rename to docker/Caddyfile diff --git a/docker/crontab b/docker/crontab new file mode 100644 index 0000000000..f67a6bf177 --- /dev/null +++ b/docker/crontab @@ -0,0 +1 @@ +* * * * * php /var/www/html/artisan schedule:run diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index af9060ec60..c6f9125dc2 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,7 +1,5 @@ #!/bin/ash -e -#mkdir -p /var/log/supervisord/ /var/log/php8/ \ - ## check for .env file and generate app keys if missing if [ -f /pelican-data/.env ]; then echo "external vars exist." diff --git a/docker/supervisord.conf b/docker/supervisord.conf index 9359eb1b84..085086b3f8 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -11,7 +11,6 @@ pidfile=/var/run/supervisord/supervisord.pid ; pidfile location nodaemon=true ; run supervisord as a daemon minfds=1024 ; number of startup file descriptors minprocs=200 ; number of process descriptors -user=www-data ; default user [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface