forked from caikit/caikit-nlp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
45 lines (32 loc) · 1.18 KB
/
Dockerfile
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
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as builder
RUN microdnf update -y && \
microdnf install -y \
git python39-pip && \
pip3 install --upgrade --no-cache-dir pip && \
microdnf clean all
RUN python3 -m venv /opt/caikit/
ENV VIRTUAL_ENV=/opt/caikit
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
COPY dist/caikit_nlp*.whl /tmp/
RUN pip install --no-cache /tmp/caikit_nlp*.whl && rm /tmp/caikit_nlp*.whl
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as deploy
RUN microdnf update -y && \
microdnf install -y \
shadow-utils python39 && \
microdnf clean all
COPY --from=builder /opt/caikit /opt/caikit
COPY LICENSE /opt/caikit/
COPY README.md /opt/caikit/
RUN groupadd --system caikit --gid 1001 && \
adduser --system --uid 1001 --gid 0 --groups caikit \
--home-dir /caikit --shell /sbin/nologin \
--comment "Caikit User" caikit
ENV VIRTUAL_ENV=/opt/caikit
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
USER caikit
ENV RUNTIME_LIBRARY=caikit_nlp
# Optional: use `CONFIG_FILES` and the /caikit/ volume to explicitly provide a configuration file and models
# ENV CONFIG_FILES=/caikit/caikit.yml
VOLUME ["/caikit/"]
WORKDIR /caikit
CMD ["python"]