Skip to content

Commit

Permalink
Merge pull request #8 from ZPascal/issue-2
Browse files Browse the repository at this point in the history
feat: Add the cronjob config
  • Loading branch information
ZPascal authored Sep 1, 2024
2 parents ded8661 + 2b53c38 commit b04361e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
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.

0 comments on commit b04361e

Please sign in to comment.