docker
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
app/__pycache__/*
|
||||
*.pdf
|
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -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
14
app/Dockerfile
Normal 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
|
@@ -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
2
app/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
flask
|
||||
fpdf
|
10
docker-compose.yaml
Normal file
10
docker-compose.yaml
Normal 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`)
|
Reference in New Issue
Block a user