aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-10-10 15:11:56 +0200
committerGravatar Gareth Coles <[email protected]>2018-10-10 15:11:56 +0200
commit11a980feb09012db3e75d8817f908436eb13db68 (patch)
tree51900706dce1c5c23cb0bf44315b4de6fffee35a
parentMerge pull request #34 from markylon/master (diff)
Dockerfile and build script
-rw-r--r--docker/Dockerfile15
-rwxr-xr-xdocker/build.sh19
2 files changed, 34 insertions, 0 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644
index 00000000..9c4406bf
--- /dev/null
+++ b/docker/Dockerfile
@@ -0,0 +1,15 @@
+FROM python:3.6-alpine3.7
+RUN apk add --update tini git
+
+RUN mkdir /bot
+COPY . /bot
+WORKDIR /bot
+
+ENV LIBRARY_PATH=/lib:/usr/lib
+
+RUN pip install pipenv
+RUN pipenv install --deploy --system
+
+ENTRYPOINT ["/sbin/tini", "--"]
+CMD ["python", "-m", "bot"]
+
diff --git a/docker/build.sh b/docker/build.sh
new file mode 100755
index 00000000..337f47c6
--- /dev/null
+++ b/docker/build.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Build and deploy on master branch
+#if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
+ echo "Connecting to docker hub"
+ echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
+
+ echo "Building image"
+ docker build -t pythondiscord/hacktober-bot:latest -f docker/Dockerfile .
+
+ echo "Pushing image"
+ docker push pythondiscord/hacktober-bot:latest
+
+# echo "Deploying container"
+# curl -H "token: $AUTODEPLOY_TOKEN" $AUTODEPLOY_WEBHOOK
+#else
+# echo "Skipping deploy"
+#fi
+