24 lines
619 B
Docker
24 lines
619 B
Docker
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
# Tesseract (OCR) + langue française, pour l'import par capture d'écran.
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
tesseract-ocr tesseract-ocr-fra \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# psycopg2-binary embarque sa propre libpq : pas besoin de build-essential.
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
RUN DJANGO_SECRET_KEY=build python manage.py collectstatic --noinput
|
|
|
|
EXPOSE 8000
|
|
RUN chmod +x /app/entrypoint.sh
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|