MB-IDK commited on
Commit
86dfba8
·
verified ·
1 Parent(s): 582e3cc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -9
Dockerfile CHANGED
@@ -1,20 +1,20 @@
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
5
- # Installer les dépendances système nécessaires à cloudscraper
6
  RUN apt-get update && \
7
- apt-get install -y --no-install-recommends \
8
- gcc \
9
- libffi-dev \
10
- && rm -rf /var/lib/apt/lists/*
11
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- COPY hibp_api.py .
16
 
17
- EXPOSE 5000
 
18
 
19
- # Gunicorn en production (1 worker car cloudscraper garde un état de session)
20
- CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--timeout", "60", "hibp_api:app"]
 
 
1
  FROM python:3.11-slim
2
 
3
+ RUN useradd -m -u 1000 user
4
  WORKDIR /app
5
 
 
6
  RUN apt-get update && \
7
+ apt-get install -y --no-install-recommends gcc libffi-dev && \
8
+ rm -rf /var/lib/apt/lists/*
 
 
9
 
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ COPY app.py .
14
 
15
+ RUN chown -R user:user /app
16
+ USER user
17
 
18
+ EXPOSE 7860
19
+
20
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]