build: compose with a crontab

This commit is contained in:
2026-04-20 18:58:11 +02:00
parent 1920fe3a00
commit 3064fe5492
4 changed files with 20 additions and 7 deletions
+2 -1
View File
@@ -7,4 +7,5 @@ compose.yml
letsencrypt letsencrypt
.coverage .coverage
htmlcov htmlcov
coverage.xml coverage.xml
crontab
+2 -2
View File
@@ -22,9 +22,9 @@ RUN PIP_ROOT_USER_ACTION=ignore python3 -m pip install uv
COPY uv.lock pyproject.toml ./ COPY uv.lock pyproject.toml ./
RUN uv sync --no-dev RUN uv pip install -r pyproject.toml --system
COPY main.py favicon.ico ./ COPY main.py favicon.ico ./
COPY src/* ./src/ COPY src/* ./src/
ENTRYPOINT [ "uv", "run", "--no-sync", "main.py"] ENTRYPOINT [ "/app/main.py"]
+13 -4
View File
@@ -10,7 +10,16 @@ services:
volumes: volumes:
- "./data:/data" - "./data:/data"
- "./letsencrypt:/etc/letsencrypt" - "./letsencrypt:/etc/letsencrypt"
environment: env_file: .env
- HOST=${HOST} command: --debug run
- TOKEN_SALT=${TOKEN_SALT}
command: run stapler-crontab:
build: .
restart: unless-stopped
volumes:
- "./data:/data"
- "./letsencrypt:/etc/letsencrypt"
- "./crontab:/etc/crontabs/root"
env_file: .env
entrypoint: /usr/sbin/crond -f
+3
View File
@@ -0,0 +1,3 @@
# do daily/weekly/monthly maintenance
# min hour day month weekday command
0 3 * * 1 /app/main.py renew