Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add the cronjob config #8

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ The repository includes a [Pretix](https://pretix.eu/about/de/) docker-compose c

## Usage

You can execute `docker-compose up -d` to start all related containers.
You can execute `docker-compose up -d --build --force-recreate` to start and build all related containers.

### Cronjobs

It is possible to adapt the `pretixuser` crontab entries by modifying the [crontab.bak](docker/pretix/crontab.bak) file.

## Contribution
If you would like to contribute something, have an improvement request, or want to make a change inside the code, please open a pull request.
Expand Down
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ version: '3'
services:
app:
container_name: pretix_app
image: pretix/standalone:stable
build:
dockerfile: Dockerfile
context: ./docker/pretix
restart: always
depends_on:
- database
- cache
volumes:
- pretix_data:/data
- ./docker/pretix.cfg:/etc/pretix/pretix.cfg
- ./docker/pretix/pretix.cfg:/etc/pretix/pretix.cfg
ports:
- "8000:80"
networks:
Expand Down
14 changes: 14 additions & 0 deletions docker/pretix/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM pretix/standalone:stable

USER root

RUN apt update && apt install cron nano -y

USER pretixuser

COPY crontab.bak /tmp/crontab.bak
RUN crontab /tmp/crontab.bak

EXPOSE 80
ENTRYPOINT ["pretix"]
CMD ["all"]
24 changes: 24 additions & 0 deletions docker/pretix/crontab.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
15,45 * * * * PRETIX_CONFIG_FILE=/etc/pretix/pretix.cfg python -m pretix runperiodic
File renamed without changes.