-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (54 loc) · 2.08 KB
/
Copy pathDockerfile
File metadata and controls
73 lines (54 loc) · 2.08 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# syntax=docker/dockerfile:1.7
FROM python:3.11-slim AS base
ARG ATRIUM_RUNNER_IMAGE=""
ARG ATRIUM_RUNNER_REPO="https://github.com/ufal/atrium-nlp-enrich"
ARG ATRIUM_RUNNER_REF=""
ENV ATRIUM_RUNNER_IMAGE=${ATRIUM_RUNNER_IMAGE} \
ATRIUM_RUNNER_REPO=${ATRIUM_RUNNER_REPO} \
ATRIUM_RUNNER_REF=${ATRIUM_RUNNER_REF} \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
HF_HOME=/cache/huggingface
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
bash \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt requirements-test.txt ./
RUN pip install -r requirements.txt -r requirements-test.txt
COPY . .
RUN chmod +x api_1_manifest.sh api_2_udp.sh api_3_nt.sh api_4_stats.sh \
&& useradd --create-home --uid 10001 atrium \
&& mkdir -p /cache/huggingface /data \
&& chown -R atrium:atrium /app /cache /data
USER atrium
ENTRYPOINT ["python", "run_pipeline.py"]
CMD []
# ---------------------------------------------------------------------------
# API surface — published as :<version>-api
# ---------------------------------------------------------------------------
FROM base AS api
USER root
COPY service/requirements.txt ./service_requirements.txt
RUN pip install -r service_requirements.txt
RUN chown -R atrium:atrium /app
USER atrium
EXPOSE 8000
ENTRYPOINT ["uvicorn", "service.api:app", "--host", "0.0.0.0", "--port", "8000"]
# ---------------------------------------------------------------------------
# Optional LLM/GPU variant — published as :<version>-llm
# ---------------------------------------------------------------------------
FROM base AS llm
USER root
COPY requirements_llm.txt ./
# Dynamically remove the strict torch==2.7.0 pin so vllm can install its required version
RUN sed -i '/^torch==/d' requirements_llm.txt \
&& pip install \
--extra-index-url https://download.pytorch.org/whl/cpu \
-r requirements_llm.txt
RUN chown -R atrium:atrium /app
USER atrium
ENTRYPOINT ["python", "llm_run.py"]
CMD ["llm_config.txt"]