From 42f1536c19a9b23bcdb60759b6d16e861435898e Mon Sep 17 00:00:00 2001 From: Ankur Chattopadhyay Date: Sat, 28 Mar 2020 21:22:33 +0530 Subject: [PATCH] git clone included in start.sh --- .dockerignore | 2 ++ Dockerfile | 11 +++++++---- docker-compose.yml | 6 ++---- start.sh | 10 ++++++++++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index bee8a64..4316f38 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,3 @@ __pycache__ +.dockerignore +stanford-corenlp-full-2018-10-05/ diff --git a/Dockerfile b/Dockerfile index a65c882..4ac074a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/docker-compose.yml b/docker-compose.yml index 7b863b4..7b7924b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/start.sh b/start.sh index 0b5b20d..986df3c 100644 --- a/start.sh +++ b/start.sh @@ -1,3 +1,13 @@ #!/usr/bin/env bash +if [ ! -d MapBot ]; then + git clone https://github.com/vishakha-lall/MapBot.git -b gssoc-master + cd MapBot +else + cd MapBot + git pull +fi + +export GCLOUD_API_KEY= + docker-compose up -d && docker attach mapbot_bot