build: compose with a crontab
This commit is contained in:
@@ -8,3 +8,4 @@ letsencrypt
|
||||
.coverage
|
||||
htmlcov
|
||||
coverage.xml
|
||||
crontab
|
||||
+2
-2
@@ -22,9 +22,9 @@ RUN PIP_ROOT_USER_ACTION=ignore python3 -m pip install uv
|
||||
|
||||
COPY uv.lock pyproject.toml ./
|
||||
|
||||
RUN uv sync --no-dev
|
||||
RUN uv pip install -r pyproject.toml --system
|
||||
|
||||
COPY main.py favicon.ico ./
|
||||
COPY src/* ./src/
|
||||
|
||||
ENTRYPOINT [ "uv", "run", "--no-sync", "main.py"]
|
||||
ENTRYPOINT [ "/app/main.py"]
|
||||
+13
-4
@@ -10,7 +10,16 @@ services:
|
||||
volumes:
|
||||
- "./data:/data"
|
||||
- "./letsencrypt:/etc/letsencrypt"
|
||||
environment:
|
||||
- HOST=${HOST}
|
||||
- TOKEN_SALT=${TOKEN_SALT}
|
||||
command: run
|
||||
env_file: .env
|
||||
command: --debug 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
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# do daily/weekly/monthly maintenance
|
||||
# min hour day month weekday command
|
||||
0 3 * * 1 /app/main.py renew
|
||||
Reference in New Issue
Block a user