File size: 805 Bytes
347833f
40304b5
347833f
 
 
 
40304b5
 
 
 
 
 
347833f
 
 
 
 
 
 
 
40304b5
 
 
347833f
 
40304b5
d95ac6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Dockerfile
# Dockerfile
FROM python:3.10-slim

ENV PIP_NO_CACHE_DIR=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    HF_HOME=/app/cache \
    XDG_CACHE_HOME=/app/cache \
    HUGGINGFACE_HUB_CACHE=/app/cache/huggingface \
    TRANSFORMERS_CACHE=/app/cache/huggingface \
    TORCH_HOME=/app/cache/torch

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential git && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY requirements.txt /app/
RUN pip install --upgrade pip && pip install -r requirements.txt

# crea carpeta de cache con permisos amplios para el usuario que ejecute el contenedor
RUN mkdir -p /app/cache && chmod -R 777 /app/cache

COPY . /app

# ¡ojo con el nombre del módulo!
CMD sh -c 'uvicorn server1:app --host 0.0.0.0 --port ${PORT:-7860}'