1
- # We use the official Superset image here instead of building our own from scratch
2
- # to avoid having to deal with python dependencies and Nexus integration. We might
3
- # change this in the future.
1
+ # Build stage
2
+
3
+ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5 as builder
4
4
5
5
ARG PRODUCT
6
- ARG _BASE_IMAGE_TAG
7
- ARG RELEASE="1"
6
+ ARG PYTHON
7
+
8
+ COPY superset/constraints-${PRODUCT}.txt /tmp/constraints.txt
9
+
10
+ RUN microdnf update \
11
+ && microdnf install \
12
+ --assumeyes \
13
+ cyrus-sasl-devel \
14
+ gcc \
15
+ gcc-c++ \
16
+ libffi-devel \
17
+ openldap-devel \
18
+ openssl-devel \
19
+ python${PYTHON}-devel \
20
+ python${PYTHON}-pip \
21
+ python${PYTHON}-wheel \
22
+ && microdnf clean all \
23
+ && python3 -m venv /stackable/app \
24
+ && source /stackable/app/bin/activate \
25
+ && pip install \
26
+ --no-cache-dir \
27
+ --upgrade \
28
+ setuptools \
29
+ pip \
30
+ && pip install \
31
+ --no-cache-dir \
32
+ --upgrade \
33
+ --constraint /tmp/constraints.txt \
34
+ apache-superset==${PRODUCT} \
35
+ gevent \
36
+ psycopg2-binary \
37
+ statsd \
38
+ python-ldap
39
+
40
+ # Final image
8
41
9
- FROM apache/superset:$_BASE_IMAGE_TAG
42
+ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5
43
+
44
+ ARG PYTHON
45
+ ARG RELEASE=1
10
46
11
47
LABEL name="Apache Superset" \
12
48
@@ -16,12 +52,40 @@ LABEL name="Apache Superset" \
16
52
summary="The Stackable image for Apache Superset." \
17
53
description="This image is deployed by the Stackable Operator for Apache Superset."
18
54
55
+ ENV FLASK_ENV="production" \
56
+ HOME="/stackable" \
57
+ SUPERSET_PORT="8088"
58
+ ENV PATH="${HOME}/app/bin:${PATH}" \
59
+ PYTHONPATH="${HOME}/app/pythonpath"
60
+
61
+ RUN microdnf update \
62
+ && microdnf install \
63
+ --assumeyes \
64
+ cyrus-sasl \
65
+ openldap \
66
+ openldap-clients \
67
+ openssl-libs \
68
+ openssl-pkcs11 \
69
+ python${PYTHON} \
70
+ shadow-utils \
71
+ && microdnf clean all \
72
+ && groupadd --gid 1000 stackable \
73
+ && useradd --uid 1000 --gid stackable --home-dir ${HOME} stackable
74
+
19
75
COPY superset/licenses /licenses
76
+ COPY --from=builder /stackable ${HOME}
77
+
78
+ RUN chown --recursive stackable:stackable ${HOME}
20
79
21
- USER root
22
- RUN apt update &&\
23
- apt install -y python3-dev libldap2-dev libsasl2-dev libssl-dev &&\
24
- rm -rf /var/lib/apt/lists/*
25
- USER superset
80
+ USER stackable
81
+ WORKDIR ${HOME}
26
82
27
- RUN pip install statsd python-ldap
83
+ CMD ["/bin/sh" , "-c" , \
84
+ "gunicorn \
85
+ --bind 0.0.0.0:${SUPERSET_PORT} \
86
+ --worker-class gthread \
87
+ --threads 20 \
88
+ --timeout 60 \
89
+ --limit-request-line 0 \
90
+ --limit-request-field_size 0 \
91
+ 'superset.app:create_app()'" ]
0 commit comments