Skip to content

Commit b04361e

Browse files
authored
Merge pull request #8 from ZPascal/issue-2
feat: Add the cronjob config
2 parents ded8661 + 2b53c38 commit b04361e

File tree

5 files changed

+47
-3
lines changed

5 files changed

+47
-3
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ The repository includes a [Pretix](https://pretix.eu/about/de/) docker-compose c
33

44
## Usage
55

6-
You can execute `docker-compose up -d` to start all related containers.
6+
You can execute `docker-compose up -d --build --force-recreate` to start and build all related containers.
7+
8+
### Cronjobs
9+
10+
It is possible to adapt the `pretixuser` crontab entries by modifying the [crontab.bak](docker/pretix/crontab.bak) file.
711

812
## Contribution
913
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.

docker-compose.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ version: '3'
22
services:
33
app:
44
container_name: pretix_app
5-
image: pretix/standalone:stable
5+
build:
6+
dockerfile: Dockerfile
7+
context: ./docker/pretix
68
restart: always
79
depends_on:
810
- database
911
- cache
1012
volumes:
1113
- pretix_data:/data
12-
- ./docker/pretix.cfg:/etc/pretix/pretix.cfg
14+
- ./docker/pretix/pretix.cfg:/etc/pretix/pretix.cfg
1315
ports:
1416
- "8000:80"
1517
networks:

docker/pretix/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM pretix/standalone:stable
2+
3+
USER root
4+
5+
RUN apt update && apt install cron nano -y
6+
7+
USER pretixuser
8+
9+
COPY crontab.bak /tmp/crontab.bak
10+
RUN crontab /tmp/crontab.bak
11+
12+
EXPOSE 80
13+
ENTRYPOINT ["pretix"]
14+
CMD ["all"]

docker/pretix/crontab.bak

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Edit this file to introduce tasks to be run by cron.
2+
#
3+
# Each task to run has to be defined through a single line
4+
# indicating with different fields when the task will be run
5+
# and what command to run for the task
6+
#
7+
# To define the time you can provide concrete values for
8+
# minute (m), hour (h), day of month (dom), month (mon),
9+
# and day of week (dow) or use '*' in these fields (for 'any').
10+
#
11+
# Notice that tasks will be started based on the cron's system
12+
# daemon's notion of time and timezones.
13+
#
14+
# Output of the crontab jobs (including errors) is sent through
15+
# email to the user the crontab file belongs to (unless redirected).
16+
#
17+
# For example, you can run a backup of all your user accounts
18+
# at 5 a.m every week with:
19+
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
20+
#
21+
# For more information see the manual pages of crontab(5) and cron(8)
22+
#
23+
# m h dom mon dow command
24+
15,45 * * * * PRETIX_CONFIG_FILE=/etc/pretix/pretix.cfg python -m pretix runperiodic
File renamed without changes.

0 commit comments

Comments
 (0)