-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 989 Bytes
/
Dockerfile
File metadata and controls
30 lines (23 loc) · 989 Bytes
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
#Build stage
ARG PYTHON_VERSION=3.11
ARG VARIANT=slim-bookworm
FROM python:${PYTHON_VERSION}-slim-bookworm AS builder
LABEL maintainer="LSEG Developer Relations"
#Copy requirements.txt
COPY requirements.txt .
# install dependencies to the local user directory (eg. /root/.local)
#RUN pip install --no-cache-dir --user -r requirements.txt
RUN pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --no-cache-dir --user -r requirements.txt
# Run stage
FROM python:${PYTHON_VERSION}-alpine3.20
WORKDIR /app
# Update PATH environment variable + set Python buffer to make Docker print every message instantly.
ENV PATH=/root/.local:$PATH \
PYTHONUNBUFFERED=1\
PYTHONIOENCODING=utf-8\
PYTHONLEGACYWINDOWSSTDIO=utf-8
# copy only the dependencies installation from the 1st stage image
COPY --from=builder /root/.local /root/.local
COPY src/OMMStream-MRN-LD-Env.py .
#Run Python
ENTRYPOINT ["python", "OMMStream-MRN-LD-Env.py"]