From 2cfb7303c373055116f8c96ddaa7b4f85bc5b392 Mon Sep 17 00:00:00 2001 From: iamprageeth Date: Mon, 11 Jan 2021 13:40:37 +0530 Subject: [PATCH 1/4] Added docker-compose file --- docker-compose.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bee5934 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.0' + +services: + + rs_system: + depends_on: + - redis_db + image: prageethatdocker/groveco_content_engine:1.0 + ports: + - "5000:5000" + restart: always + + redis_db: + image: redis + command: [sh, -c, "rm -f /data/dump.rdb && redis-server --save ''"] From 15aac1e3a1a74cc8da34f832617430cabac1cdd7 Mon Sep 17 00:00:00 2001 From: iamprageeth Date: Mon, 11 Jan 2021 13:47:19 +0530 Subject: [PATCH 2/4] Fixed lib versions --- requirements.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3c612d5..4b1d7c2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,14 @@ Flask-API==0.6.2 -gunicorn==19.5.0 +gunicorn==19.1.1 wsgiref==0.1.2 +flask==0.10.1 +jinja2==2.8 +numpy==1.11.0 +pandas==0.18.1 +redis==2.6.2 +requests==2.10.0 +scikit-learn==0.17.1 +setuptools==20.7.0 +six==1.9.0 +wheel==0.29.0 +scipy \ No newline at end of file From bb09ca06b0203efff57cdfe191d995026cf434bf Mon Sep 17 00:00:00 2001 From: iamprageeth Date: Mon, 11 Jan 2021 13:48:04 +0530 Subject: [PATCH 3/4] Added conda env config file --- environment.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 environment.yml diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..bbe5e71 --- /dev/null +++ b/environment.yml @@ -0,0 +1,6 @@ +name: myapp +channels: + - conda-forge + - defaults +dependencies: + - python=2.7 \ No newline at end of file From 744c62d1d4fb1ba74275f9831a091acb43772d76 Mon Sep 17 00:00:00 2001 From: iamprageeth Date: Mon, 11 Jan 2021 13:48:54 +0530 Subject: [PATCH 4/4] Added docker file --- Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf8caa3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM continuumio/miniconda3:latest + +WORKDIR /app + +# Install myapp requirements +COPY environment.yml /app/environment.yml +RUN conda config --add channels conda-forge \ + && conda env create -n myapp -f environment.yml \ + && rm -rf /opt/conda/pkgs/* + +# Copy all files after to avoid rebuild the conda env each time +COPY . /app/ + +# activate the myapp environment +ENV PATH /opt/conda/envs/myapp/bin:$PATH + +# Launch the API +CMD ["bash", "-c", "source activate flask_env"] + +RUN pip install -r requirements.txt + +RUN conda install nomkl + +EXPOSE 5000 + +CMD ["bash", "-c", "python web.py"] +