afdx2 commited on
Commit
40304b5
verified
1 Parent(s): d95ac6e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -4
Dockerfile CHANGED
@@ -1,11 +1,16 @@
1
  # Dockerfile
 
2
  FROM python:3.10-slim
3
 
4
  ENV PIP_NO_CACHE_DIR=1 \
5
  PYTHONDONTWRITEBYTECODE=1 \
6
- PYTHONUNBUFFERED=1
 
 
 
 
 
7
 
8
- # deps del sistema minimas
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
  build-essential git && rm -rf /var/lib/apt/lists/*
11
 
@@ -13,8 +18,10 @@ WORKDIR /app
13
  COPY requirements.txt /app/
14
  RUN pip install --upgrade pip && pip install -r requirements.txt
15
 
16
- # copia todo (incluye tus .pt)
 
 
17
  COPY . /app
18
 
19
- # Hugging Face expone el puerto en $PORT; usamos ese valor
20
  CMD sh -c 'uvicorn server1:app --host 0.0.0.0 --port ${PORT:-7860}'
 
1
  # Dockerfile
2
+ # Dockerfile
3
  FROM python:3.10-slim
4
 
5
  ENV PIP_NO_CACHE_DIR=1 \
6
  PYTHONDONTWRITEBYTECODE=1 \
7
+ PYTHONUNBUFFERED=1 \
8
+ HF_HOME=/app/cache \
9
+ XDG_CACHE_HOME=/app/cache \
10
+ HUGGINGFACE_HUB_CACHE=/app/cache/huggingface \
11
+ TRANSFORMERS_CACHE=/app/cache/huggingface \
12
+ TORCH_HOME=/app/cache/torch
13
 
 
14
  RUN apt-get update && apt-get install -y --no-install-recommends \
15
  build-essential git && rm -rf /var/lib/apt/lists/*
16
 
 
18
  COPY requirements.txt /app/
19
  RUN pip install --upgrade pip && pip install -r requirements.txt
20
 
21
+ # crea carpeta de cache con permisos amplios para el usuario que ejecute el contenedor
22
+ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
23
+
24
  COPY . /app
25
 
26
+ # 隆ojo con el nombre del m贸dulo!
27
  CMD sh -c 'uvicorn server1:app --host 0.0.0.0 --port ${PORT:-7860}'