github-actions[bot] commited on
Commit
913d2dd
·
1 Parent(s): ac0d67e

🚀 Deploy from GitHub Actions - 2026-02-03 10:12:18

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -14
Dockerfile CHANGED
@@ -1,24 +1,40 @@
1
- FROM python:3.11-slim
 
 
 
2
 
3
- WORKDIR /app
 
 
 
 
 
 
 
4
 
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- libgomp1 \
8
- && rm -rf /var/lib/apt/lists/*
9
 
10
- # Copy requirements
11
- COPY requirements.txt .
12
 
13
- # Install Python packages
14
- RUN pip install --no-cache-dir --upgrade pip && \
15
- pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy app
18
  COPY app.py .
19
 
20
  # Expose port
21
  EXPOSE 7860
22
 
23
- # Run FastAPI
24
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
1
+ # ==============================================================================
2
+ # STAGE 1 : Builder
3
+ # ==============================================================================
4
+ FROM continuumio/miniconda3:23.10.0-1 AS builder
5
 
6
+ WORKDIR /build
7
+
8
+ # Copie les fichiers de dépendances
9
+ COPY environment.yml .
10
+
11
+ # Créer l'environnement
12
+ RUN conda env create -f environment.yml && \
13
+ conda clean -afy
14
 
15
+ # ==============================================================================
16
+ # STAGE 2 : Runtime (image finale légère)
17
+ # ==============================================================================
18
+ FROM continuumio/miniconda3:23.10.0-1
19
 
20
+ WORKDIR /app
 
21
 
22
+ # Copier l'environnement depuis le builder
23
+ COPY --from=builder /opt/conda/envs/wakee_api /opt/conda/envs/wakee_api
 
24
 
25
+ # Copier l'application
26
  COPY app.py .
27
 
28
  # Expose port
29
  EXPOSE 7860
30
 
31
+ # Variables d'environnement
32
+ ENV PYTHONUNBUFFERED=1
33
+ ENV ORT_DISABLE_TELEMETRY=1
34
+ ENV PATH=/opt/conda/envs/wakee_api/bin:$PATH
35
+
36
+ # Activer l'environnement et démarrer
37
+ SHELL ["conda", "run", "-n", "wakee_api", "/bin/bash", "-c"]
38
+
39
+ CMD ["conda", "run", "--no-capture-output", "-n", "wakee_api", \
40
+ "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]