-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtestgen.dockerfile
More file actions
50 lines (35 loc) · 1.7 KB
/
testgen.dockerfile
File metadata and controls
50 lines (35 loc) · 1.7 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
ARG TESTGEN_BASE_LABEL=v15
FROM datakitchen/dataops-testgen-base:${TESTGEN_BASE_LABEL} AS release-image
# Args have to be set in current build stage: https://github.com/moby/moby/issues/37345
ARG TESTGEN_VERSION
ARG TESTGEN_DOCKER_HUB_REPO
ARG TESTGEN_SUPPORT_EMAIL
ENV PYTHONPATH=/dk/lib/python3.13/site-packages
ENV PATH=$PATH:/dk/bin
RUN apk upgrade
# Remove interactive ODBC tools — not needed at runtime, and iusql triggers
# false-positive secret detection in security scanners (SECRET-3010)
RUN rm -f /usr/bin/iusql /usr/bin/isql
# Now install everything (hdbcli is pre-installed in the base image via manual wheel extraction)
COPY . /tmp/dk/
RUN sed -i '/hdbcli/d' /tmp/dk/pyproject.toml /tmp/dk/testgen/pyproject.toml 2>/dev/null; \
python3 -m pip install --no-cache-dir --prefix=/dk /tmp/dk
# Generate third-party license notices from installed packages
RUN pip install --no-cache-dir pip-licenses \
&& SCRIPT=$(find /tmp/dk -name generate_third_party_notices.py | head -1) \
&& PYTHONPATH=/dk/lib/python3.13/site-packages python3 "$SCRIPT" --output /dk/THIRD-PARTY-NOTICES \
&& pip uninstall -y pip-licenses
RUN rm -Rf /tmp/dk /root/.cache/pip
RUN tg-patch-streamlit
RUN addgroup -S testgen && adduser -S testgen -G testgen
# Streamlit has to be able to write to these dirs
RUN mkdir /var/lib/testgen
RUN chown -R testgen:testgen /var/lib/testgen /dk/lib/python3.13/site-packages/streamlit/static /dk/lib/python3.13/site-packages/testgen/ui/components/frontend
ENV TESTGEN_VERSION=${TESTGEN_VERSION}
ENV TESTGEN_DOCKER_HUB_REPO=${TESTGEN_DOCKER_HUB_REPO}
ENV TESTGEN_SUPPORT_EMAIL=${TESTGEN_SUPPORT_EMAIL}
ENV TG_RELEASE_CHECK=docker
USER testgen
WORKDIR /dk
ENTRYPOINT ["testgen"]
CMD [ "run-app" ]