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"] + 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 ''"] 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 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