Skip to content

Commit b371c38

Browse files
author
Wasin Waeosri
committed
Add Docker support
1 parent d4af818 commit b371c38

2 files changed

Lines changed: 41 additions & 7 deletions

File tree

README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ This example requires the following dependencies softwares and libraries.
3838
3. Python's [requests 2.x](https://pypi.org/project/requests/) library.
3939
4. Python's [websocket-client](https://pypi.org/project/websocket-client/) library (*version 0.49 or greater*).
4040
5. [Jupyter Notebook](https://jupyter.org/) runtime (for the Notebook example application)
41-
5. TRCC username, password and host list credentials. Please reach out to your Refinitiv sales associate to acquire TRCC access credentials.
41+
6. [Docker Engine - Community Edition](https://docs.docker.com/install/) (for running the console example in Docker only)
42+
7. TRCC username, password and host list credentials. Please reach out to your Refinitiv sales associate to acquire TRCC access credentials.
4243

4344
*Note:*
4445
- The Python example has been qualified with Python versions 3.6.8.
@@ -51,10 +52,11 @@ This example requires the following dependencies softwares and libraries.
5152
This example project contains the following files and folders
5253
1. *console_python/trcc_posting.py*: The example application file
5354
2. *console_python/requirements.txt*: The application dependencies configurationf file
54-
3. *notebook_python/trcc_posting_notebook.ipynb*: The example Jupyter Notebook application file
55-
4. *trep_config/rmds_trcc.cnf*: ADH TRCC configurations example file (*not a completed ADH configuration file*)
56-
5. LICENSE.md: Project's license file
57-
6. README.md: Project's README file
55+
3. *console_python/Dockerfile*: The example application Dockerfile
56+
4. *notebook_python/trcc_posting_notebook.ipynb*: The example Jupyter Notebook application file
57+
5. *trep_config/rmds_trcc.cnf*: ADH TRCC configurations example file (*not a completed ADH configuration file*)
58+
6. LICENSE.md: Project's license file
59+
7. README.md: Project's README file
5860

5961
## How to run this console example
6062

@@ -65,11 +67,26 @@ Please be informed that your TREP server (ADS and ADH) should be applied the TRC
6567
![Figure-3](images/ads_trcc.png "ADS TRCC Service is ready")
6668

6769
1. Unzip or download the example project folder into a directory of your choice.
68-
2. Run ```$> pip install -r requestments.txt``` in a console to install all the dependencies libraries.
69-
3. Then you can run trcc_posting.py application with the following command
70+
2. Enter project *console* folder.
71+
3. Run ```$> pip install -r requestments.txt``` command in a console to install all the dependencies libraries.
72+
4. Then you can run trcc_posting.py application with the following command
7073
```
7174
$> python trcc_post.py --hostname <ADS server IP Address/Hostname> --port <WebSocket Port> --item <Contribution item name> --service <ADS Contribution Service name>
7275
```
76+
77+
## How to run this console example in Docker
78+
79+
1. Unzip or download the example project folder into a directory of your choice.
80+
2. Enter *console* folder.
81+
3. Run ```$> docker build -t <project tag name> .``` command in a console to build an image from a Dockerfile.
82+
```
83+
$> docker build -t esdk_ws_trcc_python .
84+
```
85+
4. Once the build is success, you can create and run the container with the following command
86+
```
87+
$> docker run esdk_ws_trcc_python --hostname <ADS server IP Address/Hostname> --port <WebSocket Port> --item <Contribution item name> --service <ADS Contribution Service name>
88+
```
89+
7390
## Example Results
7491
### Initiate and Login to TREP
7592
```

console_python/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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 trcc_posting.py /app
14+
#COPY market_price.py /app
15+
WORKDIR /app
16+
17+
ENTRYPOINT ["python", "-u","/app/trcc_posting.py"]

0 commit comments

Comments
 (0)