CIA/e-voting-system/docker/Dockerfile.backend
2025-11-05 18:08:21 +01:00

31 lines
706 B
Docker

FROM python:3.12-slim
WORKDIR /app
# Installer les dépendances système (inclure cmake et git pour liboqs)
RUN apt-get update && apt-get install -y \
gcc \
cmake \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Installer Poetry
RUN pip install --no-cache-dir poetry
# Copier le code source en premier
COPY src/ ./src/
# Copier les fichiers de dépendances
COPY pyproject.toml poetry.lock* ./
# Installer les dépendances Python
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi --no-root
# Exposer le port
EXPOSE 8000
# Démarrer l'application
CMD ["uvicorn", "src.backend.main:app", "--host", "0.0.0.0", "--port", "8000"]