11# Build stage
2- FROM python:3.8.12-alpine3.15 AS builder
2+ ARG PYTHON_VERSION=3.10
3+ ARG VARIANT=slim-bookworm
4+ FROM python:${PYTHON_VERSION}-slim-bookworm AS builder
35
4- LABEL maintainer="Wasin Waeosri <wasin.waeosri@lseg.com> "
6+ LABEL maintainer="LSEG Developer Relations "
57
6- # Install gcc + musl-dev
7- RUN apk update && apk add --no-cache build-base gcc musl-dev
88# Copy requirements.txt
99COPY requirements.txt .
1010
11+ # ------------ Begin: For run in internal LSEG ZScaler environment ------------
12+ # Image runs internet requests over HTTPS – Install Certs if dev environment
13+
14+ # Add the CA Certificate to the container
15+ ADD ./ZscalerRootCerttificate.pem /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt
16+ RUN chmod 644 /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt && update-ca-certificates
17+ ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
18+
19+ # ------------ End: For run in internal LSEG ZScaler environment ------------
20+
21+ # Continue the build where the HTTPS Connections are made
22+
1123# install dependencies to the local user directory (eg. /root/.local)
12- RUN pip install --user -r requirements.txt
24+ RUN pip install --no-cache-dir -- user -r requirements.txt
1325
1426# Run stage
15- FROM python:3.8.12 -alpine3.15
27+ FROM --platform=linux/amd64 python:${PYTHON_VERSION} -alpine3.20
1628WORKDIR /app
1729
1830# Update PATH environment variable + set Python buffer to make Docker print every message instantly.
@@ -21,7 +33,7 @@ ENV PATH=/root/.local:$PATH \
2133
2234# copy only the dependencies installation from the 1st stage image
2335COPY --from=builder /root/.local /root/.local
24- COPY mrn_console_app .py .
36+ COPY mrn_console_rto_v2 .py .
2537
2638# Run Python
27- ENTRYPOINT ["python" , "./mrn_console_rtds .py" ]
39+ ENTRYPOINT ["python" , "mrn_console_rto_v2 .py" ]
0 commit comments