habulaj commited on
Commit
ab7a79e
verified
1 Parent(s): 8fa9755

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -2
Dockerfile CHANGED
@@ -1,15 +1,20 @@
1
  FROM python:3.9
2
 
3
  RUN apt-get update && apt-get install -y libgl1
4
- #
 
5
  RUN useradd -m -u 1000 user
6
  USER user
7
  ENV PATH="/home/user/.local/bin:$PATH"
8
 
9
  WORKDIR /app
10
 
 
11
  COPY --chown=user ./requirements.txt requirements.txt
12
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
 
14
  COPY --chown=user . /app
15
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
1
  FROM python:3.9
2
 
3
  RUN apt-get update && apt-get install -y libgl1
4
+
5
+ # Cria usu谩rio
6
  RUN useradd -m -u 1000 user
7
  USER user
8
  ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
  WORKDIR /app
11
 
12
+ # Instala depend锚ncias
13
  COPY --chown=user ./requirements.txt requirements.txt
14
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
15
 
16
+ # Copia c贸digo
17
  COPY --chown=user . /app
18
+
19
+ # Otimizado para 2vCPU / 16GB RAM: 5 workers para m谩xima concorr锚ncia
20
+ CMD ["gunicorn", "app:app", "-w", "5", "-k", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:7860", "--timeout", "120", "--worker-connections", "1000", "--max-requests", "1000", "--max-requests-jitter", "100"]