This commit is contained in:
2024-06-05 23:46:43 +02:00
parent ca460d5fba
commit 9ca094ab10
6 changed files with 32 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
app/__pycache__/*
*.pdf

2
.vscode/launch.json vendored
View File

@@ -10,7 +10,7 @@
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "makepdf.py",
"FLASK_APP": "app/app.py",
"FLASK_DEBUG": "1"
},
"args": [

14
app/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM python:3.10-alpine
WORKDIR /app
COPY requirements.txt /app
RUN --mount=type=cache,target=/root/.cache/pip \
pip3 install -r requirements.txt
COPY . /app
ENTRYPOINT ["python3"]
CMD ["app.py"]
EXPOSE 8000

View File

@@ -112,3 +112,6 @@ def generate():
mimetype="application/pdf",
download_name="test.pdf",
)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000)

2
app/requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
flask
fpdf

10
docker-compose.yaml Normal file
View File

@@ -0,0 +1,10 @@
services:
web:
build:
context: app
# flask requires SIGINT to stop gracefully
# (default stop signal from Compose is SIGTERM)
stop_signal: SIGINT
labels:
traefik.enable: true
traefik.http.routers.traefik.rule: Host(`template.ar2000.me`)