forked from LSEG-API-Samples/Example.WebSocketAPI.Python.MRN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 772 Bytes
/
Dockerfile
File metadata and controls
27 lines (20 loc) · 772 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
#Build stage
FROM python:3.8.12-alpine3.15 AS builder
LABEL maintainer="Wasin Waeosri <[email protected]>"
# Install gcc + musl-dev
RUN apk update && apk add --no-cache build-base gcc musl-dev
#Copy requirements.txt
COPY requirements.txt .
# install dependencies to the local user directory (eg. /root/.local)
RUN pip install --user -r requirements.txt
# Run stage
FROM python:3.8.12-alpine3.15
WORKDIR /app
# Update PATH environment variable + set Python buffer to make Docker print every message instantly.
ENV PATH=/root/.local:$PATH \
PYTHONUNBUFFERED=1
# copy only the dependencies installation from the 1st stage image
COPY --from=builder /root/.local /root/.local
COPY mrn_console_app.py .
#Run Python
ENTRYPOINT ["python", "./mrn_console_app.py"]