ServerX commited on
Commit
e9f5806
·
verified ·
1 Parent(s): cb722ff

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -19
Dockerfile CHANGED
@@ -7,25 +7,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
7
  python3-dev \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Configurazione PATH esplicita
11
- ENV PATH="/home/user/.local/bin:${PATH}" \
12
- PYTHONUNBUFFERED=1 \
13
- PYTHONDONTWRITEBYTECODE=1 \
14
- PORT=7860 \
15
- TIMEOUT=300
16
 
17
- # Crea utente e imposta permessi
18
- RUN useradd -m -u 1000 user && \
19
- chown -R user:user /app
20
 
21
- USER user
22
 
23
- # Installazione dipendenze
24
- COPY --chown=user requirements.txt .
25
- RUN pip install --no-cache-dir --user gunicorn==20.1.0 && \
26
- pip install --no-cache-dir --user -r requirements.txt
27
-
28
- COPY --chown=user . .
29
-
30
- # Comando ottimizzato
31
- CMD ["gunicorn", "--bind", "0.0.0.0:${PORT}", "--timeout", "${TIMEOUT}", "app:app"]
 
7
  python3-dev \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
+ RUN pip install --no-cache-dir gunicorn==20.1.0
 
 
 
 
 
11
 
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
 
14
 
15
+ COPY . .
16
 
17
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "app:app"]