Skip to content

Commit 0a1c436

Browse files
committed
Add authentication version 2 script
Update readme Update dockerfile
1 parent 07d2851 commit 0a1c436

File tree

6 files changed

+214
-109
lines changed

6 files changed

+214
-109
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Authentication Version 2
2+
CLIENT_ID=CLIENT_ID_V2
3+
CLIENT_SECRET=CLIENT_SECRET_V2

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ notebook/.env
2020

2121
old-requirements.txt
2222
mrn_console_app_rto.py
23-
websocket-api/
23+
websocket-api/
24+
25+
ZscalerRootCerttificate.pem

Dockerfile

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
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
99
COPY 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
1628
WORKDIR /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
2335
COPY --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

Comments
 (0)