File size: 795 Bytes
9d9449a
 
be5bf87
 
9d9449a
be5bf87
 
9d9449a
be5bf87
9d9449a
b3e1b1c
 
 
 
 
 
c2feb3e
 
 
 
 
9d9449a
be5bf87
 
9d9449a
 
 
be5bf87
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
29
FROM python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE="1" \
    PYTHONUNBUFFERED="1"

# hadolint ignore=DL3013
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel

WORKDIR /app/

# Download models during build instead of copying from local
COPY scripts/model_download.bash /tmp/model_download.bash
RUN python3 -m pip install --no-cache-dir huggingface-hub && \
    bash /tmp/model_download.bash && \
    rm /tmp/model_download.bash

COPY requirements.cpu.txt ./
RUN python3 -m pip install --no-cache-dir -r ./requirements.cpu.txt

COPY requirements.torch.cpu.txt ./
RUN python3 -m pip install --no-cache-dir -r ./requirements.torch.cpu.txt

COPY app ./app
COPY main.py ./

EXPOSE 8000

ENTRYPOINT ["python3", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]