Skip to content

Commit

Permalink
Merge pull request vishakha-lall#107 from chttrjeankr/docker_hub_integ
Browse files Browse the repository at this point in the history
Clone the code, download StanfordCoreNLP in DockerFile vishakha-lall#79 resolved
  • Loading branch information
vishakha-lall authored Mar 29, 2020
2 parents 28b2121 + d7be198 commit 1a3f273
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__pycache__
.dockerignore
stanford-corenlp-full-2018-10-05/
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM python:3.6
FROM python:3.6-slim-stretch

RUN apt-get update && apt-get install -y git wget unzip

COPY requirements.txt ./requirements.txt
RUN pip install -r requirements.txt

COPY . /usr/var/MapBot
WORKDIR /usr/var/MapBot
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh

ENTRYPOINT ["/bin/sh","./docker-entrypoint.sh"]
WORKDIR /usr/var/MapBot
ENTRYPOINT ["/bin/sh","/usr/local/bin/docker-entrypoint.sh"]
1 change: 0 additions & 1 deletion ENV/docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ DB_PASSWORD=root
DB_HOST=db
DATABASE=mapbot
DB_PORT=3306
GCLOUD_API_KEY=<YOUR_API_KEY_HERE>
JAVAHOME=/usr/local/openjdk-11/bin/java
STANFORD_PATH_TO_JAR=./stanford-corenlp-full-2018-10-05/stanford-corenlp-3.9.2.jar
STANFORD_PATH_TO_MODELS_JAR=./stanford-corenlp-full-2018-10-05/stanford-corenlp-3.9.2-models.jar
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<p align="center">
<img src="https://forthebadge.com/images/badges/made-with-python.svg">
</p>

# MapBot

#### Hey! I'm your friendly navigator bot! Try me out, not to brag but I'm FUN!
Expand Down Expand Up @@ -66,16 +70,15 @@ Check out all related information [here](GSSoC.md)
- Verify the installations by `docker --version` and `docker-compose --version`

#### How to set me up Docker style?
- Clone the repository
- Run `git update-index --assume-unchanged ENV/*`
- Modify *only* the following fields in `ENV/docker.env` with the corresponding values:
- `GCLOUD_API_KEY=<your_Google_Cloud_API_key>`
- Download the `start.sh` and modify it appropriately:
- `git clone <GITHUB_LINK_OF_REPO_TO_CLONE> -b <BRANCH_NAME_TO_CHECKOUT>`
- `export GCLOUD_API_KEY=<YOUR_API_KEY_HERE>`
- You're all set up, kick off with `start.sh` file by running `bash start.sh`.

------
#### How do I work?

The analysis folder contains data files for the project. The sentences.csv contains the base training dataset which is used to classify the user's input into three classes - Statement, Question, and Chat. Going through some examples would clarify the difference between statement and chat. The featuresDump.csv is the result of text pre-processing done using the code in features.py and featuresDump.py.
The `/analysis` folder contains data files for the project. The `sentences.csv` contains the base training dataset which is used to classify the user's input into three classes - *Statement*, *Question*, and *Chat*. Going through some examples would clarify the difference between statement and chat. The `featuresDump.csv` is the result of text pre-processing done using the code in `features.py` and `featuresDump.py`.

------
#### Want to see me in action?
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ services:
- java_storage:/usr/local/openjdk-11/

bot:
image: python:3.6
image: chttrje/chatbot
container_name: mapbot_bot
environment:
- DOCKER=Y
build:
context: .
dockerfile: Dockerfile
- GCLOUD_API_KEY
depends_on:
- db
- java
Expand Down
2 changes: 2 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set -ex

git pull

if [ ! -d ./stanford-corenlp-full-2018-10-05 ]; then
wget http://nlp.stanford.edu/software/stanford-corenlp-full-2018-10-05.zip -nc -c
fi
Expand Down
8 changes: 7 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env bash

docker-compose up -d && docker attach mapbot_bot
if [ ! -d MapBot ]; then
git clone https://github.com/vishakha-lall/MapBot.git -b gssoc-master
fi

export GCLOUD_API_KEY=<YOUR_API_KEY_HERE>

docker-compose -f ./MapBot/docker-compose.yml up -d && docker attach mapbot_bot

0 comments on commit 1a3f273

Please sign in to comment.