Deploying Interplay from Github in Docker

Written By Chetan Iterate ()

Updated at December 14th, 2020

Sometime we as the developer want to use the interplay for deploying a smaller web or micro service, Implement a ML model or simply integrate an API from a startup in your business and interplay gives a nice feature to get all the interplay working and features in a simple and single docker instance. want to know how you do that ? its here :

Prerequisites : 

1) Git Client installation https://git-scm.com/downloads

1) Docker Installation for your local machine, the steps could be found on https://docs.docker.com/get-started/

2) Familiarity with docker concepts and working (Kubernetes knowledge is not required)

Steps :

1) First clone the repository of interplay in your required directory

git clone https://github.com/IterateAI/InterPlay.git

Then head into Interplay/Interplay_v4 Directory

2) Sometimes Environmental Variables are required when we are running containers in Cloud environment (Such as GCP and AWS), These can be given as

  1. as command line eg. : docker run -it -e MODE=test Ubuntu bash
  2. or giving direct list of variables in list file (in text format): docker run -it --env-file env.list ubuntu bash

3) after setting up your required values build docker container

  1. For Windows. : docker build -t <Yournametag>:<Version>
  2. For Mac/Ubuntu/other Linux. : docker build -t <Yournametag>:<Version>or./build.sh

4) At setting up the docker file, we would need to set up a port(for web interface). The following command is used for to bind docker's port to our system's port. you can override predefined environmental values while building container by '--env-file'.

docker run --env-file environment_filename --name container_name -p host_port:container_port -it interplay /bin/bash
For Ex:
docker run --env-file iterate_DEV.env --name interplay_dev -p 80:1880 -it interplay /bin/bash

5) Start your docker with this command:

docker start <Yournametag>egdocker start interplay_dev

In case you need to check your port bindings, we can view as :

docker ps -a

Notes : 

Following these steps will deploy a docker environment with interplay dependencies.And you are able to access the interplay instence by

http://localhost:<port_no>/admineghttp://localhost:8080/admin


 The docker is preconfigured to restart its dependencies by every minute to keep your docker instance alive and running by itself.

You can manipulate docker's running configuration by directly accessing it's bash function by:

docker exec <container-name> /bin/bash

Data sharing with another docker instance or applications

docker run -it -v <host_path> : <guest_path> -p host_port:container interplay /bin/bash

For example, if you have some data in /media/data/files and you would like it to be accessible in the container in /data. You should run: 

docker run -it -v /media/data/files:/data -p 80:1880 interplay /bin/bash

Was this article helpful?