From 3aea6dd8e795e20f165215b60703bf56855c5e03 Mon Sep 17 00:00:00 2001 From: Ian Adam Naval Date: Mon, 21 Jan 2019 23:52:26 -0500 Subject: [PATCH] Add a Docker environment --- Dockerfile | 22 ++++++++++++++++++++++ Makefile | 10 ++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..81dd04e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.7.2 + +EXPOSE 5000 +VOLUME /app + +RUN pip install pipenv + +WORKDIR /app + +ADD Pipfile . +ADD Pipfile.lock . +RUN pipenv install --system --deploy --ignore-pipfile --verbose + +ENV AUTOPILOT_USERNAME "" +ENV AUTOPILOT_PASSWORD "" +ENV AUTOPILOT_USER_ID -1 + +ADD ./autopilot /app/autopilot + +CMD ["uwsgi", "--http", "0.0.0.0:5000", \ + "--protocol", "uwsgi", \ + "--wsgi", "autopilot.app:app"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2cfbe60 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +default: run + +run: build + docker run -v $(CURDIR):/app -p "5000:5000" --env-file=.env ianonavy/autopilot + +build: Dockerfile + docker build -t ianonavy/autopilot . + +release: + docker push ianonavy/autopilot:latest