forked from road-core/service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile
59 lines (44 loc) · 2.09 KB
/
Containerfile
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
# vim: set filetype=dockerfile
ARG LIGHTSPEED_RAG_CONTENT_IMAGE=quay.io/openshift-lightspeed/lightspeed-rag-content@sha256:a91aca8224b1405e7c91576374c7bbc766b2009b2ef852895c27069fffc5b06f
FROM ${LIGHTSPEED_RAG_CONTENT_IMAGE} as lightspeed-rag-content
FROM registry.redhat.io/ubi9/ubi-minimal:latest
ARG VERSION
# todo: this is overriden by the image ubi9/python-311, we hard coded WORKDIR below to /app-root
# makesure the default value of rag content is set according to APP_ROOT and then update the operator.
ARG APP_ROOT=/app-root
RUN microdnf install -y --nodocs --setopt=keepcache=0 --setopt=tsflags=nodocs \
python3.11 python3.11-devel python3.11-pip
# PYTHONDONTWRITEBYTECODE 1 : disable the generation of .pyc
# PYTHONUNBUFFERED 1 : force the stdout and stderr streams to be unbuffered
# PYTHONCOERCECLOCALE 0, PYTHONUTF8 1 : skip legacy locales and use UTF-8 mode
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONCOERCECLOCALE=0 \
PYTHONUTF8=1 \
PYTHONIOENCODING=UTF-8 \
LANG=en_US.UTF-8 \
PIP_NO_CACHE_DIR=off
WORKDIR /app-root
COPY --from=lightspeed-rag-content /rag/vector_db/ocp_product_docs ./vector_db/ocp_product_docs
COPY --from=lightspeed-rag-content /rag/embeddings_model ./embeddings_model
# Add explicit files and directories
# (avoid accidental inclusion of local directories or env files or credentials)
COPY runner.py requirements.txt ./
RUN pip3.11 install --no-cache-dir -r requirements.txt
COPY ols ./ols
# this directory is checked by ecosystem-cert-preflight-checks task in Konflux
COPY LICENSE /licenses/
# Run the application
EXPOSE 8080
EXPOSE 8443
CMD ["python3.11", "runner.py"]
LABEL io.k8s.display-name="OpenShift LightSpeed Service" \
io.k8s.description="AI-powered OpenShift Assistant Service." \
io.openshift.tags="openshift-lightspeed,ols" \
description="Red Hat OpenShift Lightspeed Service" \
summary="Red Hat OpenShift Lightspeed Service" \
com.redhat.component=openshift-lightspeed-service \
name=openshift-lightspeed-service \
vendor="Red Hat, Inc."
# no-root user is checked in Konflux
USER 1001