Skip to content

Commit

Permalink
Move Caddyfile/crontab config into docker directory, remove redundant…
Browse files Browse the repository at this point in the history
… supervisord user
  • Loading branch information
PseudoResonance committed Jan 19, 2025
1 parent fd3cce2 commit 30f765e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**.DS_Store
.env
.devcontainer
.dockerignore
.editorconfig
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions docker/crontab
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* * * * * php /var/www/html/artisan schedule:run
2 changes: 0 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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."
Expand Down
1 change: 0 additions & 1 deletion docker/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30f765e

Please sign in to comment.