feat: Containerfile und Entrypoint
Basis-Image docker.io/library/python:3.12.11-slim wie im Brief gepinnt (Tag existiert auf Docker Hub, kein Patch-Bump nötig, verifiziert via podman pull). Zusätzlich finance/.containerignore ergänzt (.venv/, tests/, .env, *.sqlite, inbox/, uploads/), da der Build-Kontext sonst echte Bank-PDFs aus tests/fixtures/ sowie die ~150MB .venv/ in den Container-Build einschleusen würde. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
6
finance/.containerignore
Normal file
6
finance/.containerignore
Normal file
@@ -0,0 +1,6 @@
|
||||
.venv/
|
||||
tests/
|
||||
.env
|
||||
*.sqlite
|
||||
inbox/
|
||||
uploads/
|
||||
12
finance/Containerfile
Normal file
12
finance/Containerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM docker.io/library/python:3.12.11-slim
|
||||
|
||||
WORKDIR /srv/finance
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY app/ app/
|
||||
COPY alembic/ alembic/
|
||||
COPY alembic.ini .
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
EXPOSE 8000
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
4
finance/entrypoint.sh
Executable file
4
finance/entrypoint.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
alembic upgrade head
|
||||
exec uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
Reference in New Issue
Block a user