-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.backend
More file actions
31 lines (21 loc) · 821 Bytes
/
Copy pathDockerfile.backend
File metadata and controls
31 lines (21 loc) · 821 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
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
HF_HOME=/opt/huggingface \
HF_HUB_CACHE=/opt/huggingface/hub \
TRANSFORMERS_CACHE=/opt/huggingface/transformers \
SENTENCE_TRANSFORMERS_HOME=/opt/huggingface/sentence-transformers
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl wget libgomp1 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/requirements.txt
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r /app/requirements.txt \
&& pip install --no-cache-dir "ray[serve]"
RUN mkdir -p /opt/huggingface
COPY . /app
EXPOSE 8000 8265
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=5 \
CMD curl -fsS http://127.0.0.1:8000/ || exit 1
CMD ["python", "-m", "ray_app.app"]