Add helper entrypoint scripts

This keeps the configuration for what to run inside the container, without adding the extra weight and config of s6
This commit is contained in:
Jake Howard 2023-02-22 08:53:42 +00:00
parent 7d20ccd8d7
commit 4326dc2299
Signed by: jake
GPG Key ID: 57AFB45680EDD477
5 changed files with 23 additions and 1 deletions

View File

@ -51,7 +51,7 @@ COPY --chown=website ./website ./website
RUN SECRET_KEY=none python manage.py collectstatic --noinput --clear
CMD python manage.py migrate --noinput && gunicorn -c etc/gunicorn.conf.py
CMD ["/app/etc/entrypoints/web"]
# Just dev stuff
FROM production as dev

5
etc/entrypoints/cron Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
exec supercronic etc/crontab

5
etc/entrypoints/nginx Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
exec nginx -g "daemon off;"

7
etc/entrypoints/web Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
python manage.py migrate --noinput
exec gunicorn -c etc/gunicorn.conf.py

5
etc/entrypoints/worker Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
exec python manage.py rqworker --with-scheduler