-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (26 loc) · 765 Bytes
/
Dockerfile
File metadata and controls
39 lines (26 loc) · 765 Bytes
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
30
31
32
33
34
35
36
37
38
39
FROM python:3.12-slim AS builder
RUN apt-get update && apt-get install -y \
ca-certificates \
build-essential \
git \
curl \
libffi-dev \
libopenblas-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Pre-download huggingface model
COPY download_model.py .
RUN python download_model.py
COPY src/ .
FROM python:3.12-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local /usr/local
COPY --from=builder /root/.cache/huggingface /root/.cache/huggingface
COPY --from=builder /app /app
EXPOSE 5000
CMD ["flask", "run", "--host=0.0.0.0"]