88bdf6f34b
- Split monolithic app.py into server/api/ routers - Add Pydantic schemas for input validation - Add /agent/* API with separate AGENT_TOKEN auth - Replace static schema.sql with versioned migrations (datenerhaltend) - Add tools/backup_db.py for SQLite backups - Add Dockerfile HEALTHCHECK and compose.yml AGENT_TOKEN env - Add pytest tests for user and agent API - Update README with API docs and deployment safety notes - Bump version to 1.2.0
24 lines
621 B
Docker
24 lines
621 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
COPY pyproject.toml /app/pyproject.toml
|
|
COPY server /app/server
|
|
RUN pip install --no-cache-dir -U pip && pip install --no-cache-dir .
|
|
|
|
COPY frontend /app/frontend
|
|
COPY tools /app/tools
|
|
RUN python tools/build_frontend.py
|
|
|
|
COPY meds.yaml messages.yaml /app/
|
|
|
|
EXPOSE 8000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health/')" || exit 1
|
|
|
|
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000"]
|