Skip to content

Commit c411a23

Browse files
author
Wasin Waeosri
committed
Merge branch 'docker'
Support Docker
2 parents 39de820 + a467490 commit c411a23

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM python:3.7-alpine
2+
3+
LABEL maintainer="Wasin Waeosri <wasin.waeosri@rifinitiv.com>"
4+
LABEL build_date="2019-07-30"
5+
6+
# Copy requirements.txt first
7+
COPY requirements.txt /
8+
# instruction to be run during image build
9+
RUN pip install -r requirements.txt
10+
11+
# then copy the application
12+
RUN mkdir /app
13+
COPY mrn_console_app.py /app
14+
WORKDIR /app
15+
16+
ENTRYPOINT ["python", "/app/mrn_console_app.py"]

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ This example requires the following dependencies softwares and libraries.
4141
2. [Python](https://www.python.org/) compiler and runtime
4242
3. Python's [requests 2.x](https://pypi.org/project/requests/) library.
4343
4. Python's [websocket-client](https://pypi.org/project/websocket-client/) library (*version 0.49 or greater*).
44-
5. [Classic Jupyter Notebook](https://jupyter.org/) runtime (for the Notebook example application)
44+
5. [Classic Jupyter Notebook](https://jupyter.org/) runtime (for the Notebook example application only)
45+
6. [Docker Engine - Community Edition](https://docs.docker.com/install/) (for running the console example in Docker only)
4546

4647
*Note:*
47-
- The Python example has been qualified with Python versions 3.6.5.
48+
- The Python example has been qualified with Python versions 3.6.5 and Python 3.7.4 (Docker 19.03.1 - CentOS 7)
4849
- Please refer to the [pip installation guide page](https://pip.pypa.io/en/stable/installing/) if your environment does not have the [pip tool](https://pypi.org/project/pip/) installed.
4950
- If your environment already have a websocket-client library installed, you can use ```pip list``` command to verify a library version, then use ```pip install --upgrade websocket-client``` command to upgrade websocket-client library.
5051
- It is not advisable to change the ADH/ADS configuration, if you are not familiar with the configuration procedures. Please consult your Market Data administrator for any questions regarding TREP-MRN service configuration.
@@ -54,6 +55,7 @@ This example requires the following dependencies softwares and libraries.
5455
This example project contains the following files and folders
5556
1. *mrn_console_app.py*: The example application file
5657
2. *notebook_python/mrn_notebook_app.ipynb*: The example Jupyter Notebook application file
58+
3. *Dockerfile*: The example application Dockerfile
5759
3. *requirements.txt*: The application dependencies configurationf file
5860
4. LICENSE.md: Project's license file
5961
5. README.md: Project's README file
@@ -70,6 +72,18 @@ Please be informed that your TREP server (ADS and ADH) should have a Service tha
7072
```
7173
Optionally, the application subscribes ```MRN_STORY``` RIC code from TREP by default. You can pass your interested MRN RIC code to ```--ric``` parameter on the application command line. The supported MRN RIC codes are ```MRN_STORY```, ```MRN_TRNA```, ```MRN_TRNA_DOC``` and ```MRN_TRSI``` only. the application
7274
75+
## How to run this console example in Docker
76+
77+
1. Unzip or download the example project folder into a directory of your choice.
78+
2. Run ```$> docker build -t <project tag name> .``` in a console to build an image from a Dockerfile.
79+
```
80+
$> docker build -t esdk_ws_mrn_python .
81+
```
82+
3. Once the build is success, you can create and run the container with the following command
83+
```
84+
$> docker run esdk_ws_mrn_python --hostname <ADS server IP Address/Hostname> --port <WebSocket Port> --ric <MRN RIC name>
85+
```
86+
7387
## Example Results
7488
### Send MRN_STORY request to TREP
7589
```

0 commit comments

Comments
 (0)