Dockerfile 646 B

123456789101112131415161718192021222324252627282930313233
  1. # ---------- BUILD STAGE ----------
  2. FROM docker.io/python:3.13-alpine AS builder
  3. RUN apk add --no-cache build-base ffmpeg-dev libopusenc-dev
  4. WORKDIR /build
  5. COPY requirements.txt .
  6. RUN pip install --prefix=/install -r requirements.txt
  7. # ---------- RUNTIME STAGE ----------
  8. FROM docker.io/python:3.13-alpine
  9. RUN python3 -m pip uninstall pip -y
  10. RUN apk add ffmpeg libopusenc
  11. COPY --from=builder /install /usr/local
  12. # Définir le répertoire de travail
  13. WORKDIR /opt/chatbot
  14. COPY . .
  15. # OpenShift : permissions pour UID arbitraire
  16. RUN chown -R 0:0 /opt/chatbot && chmod -R g+rwX /opt/chatbot
  17. # Lancer le bot
  18. CMD ["python", "chatbot.py"]