mirror of
https://github.com/R0m1k3/TodoFlow.git
synced 2026-10-18 04:38:07 +02:00
feat: initial commit for TodoFlow - Conteneurised API and Glassmorphic Desktop Widget
This commit is contained in:
commit
a996f0694b
23 files changed
+1897
No files matched your search
@@ -0,0 +1,35 @@
|
||||
# --- Stage 1: Build dependencies ---
|
||||
FROM python:3.11-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir --user -r requirements.txt
|
||||
|
||||
# --- Stage 2: Final Minimal Image ---
|
||||
FROM python:3.11-slim AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copie des dépendances compilées depuis builder
|
||||
COPY --from=builder /root/.local /root/.local
|
||||
COPY . /app
|
||||
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Création d'un répertoire pour la base de données SQLite persistante
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
# Création d'un utilisateur système non-privilégié pour des raisons de sécurité
|
||||
RUN useradd -u 8888 appuser && chown -R appuser:appuser /app
|
||||
USER appuser
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
# Lancement d'Uvicorn
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in new issue
Block a user