From 68f267cd0b2df6abe67330f4cb2ee26ab046aabe Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sat, 20 Jan 2018 12:24:51 +0100 Subject: [PATCH 1/3] Fix django dependency in requirements.txt With pip 9.0.1 - the current newest version - this specification is invalid. Just require 1.11 or newer. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index adc7140..d3b99d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -django>=1.10,1.11 +django>=1.11 celery django-celery jsonpickle From 0e18482f4e2f3daca0306cd774f85bd6b44ee70c Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sat, 20 Jan 2018 12:16:00 +0100 Subject: [PATCH 2/3] add a travis configuration file travis is a service that automatically runs the build on each commit --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..68df54b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: python + +python: + - "3.5" + - "3.6" + +install: + - pip3 install -r requirements.txt + +script: + # No tests at the moment, so just import the ticker + python -c 'import ticker' From 08c617b668a5838c47f1ce1b5a6f80587da41816 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Wed, 24 Jan 2018 22:17:47 +0100 Subject: [PATCH 3/3] Add a dockerfile and makefile for development Currently, installing the ticker app changes the system/user python package list. Instead, allow using a docker image for development. Add a Makefile with two common commands for convenience. --- Dockerfile | 10 ++++++++++ Makefile | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..70ae034 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3 + +WORKDIR /ticker/ +COPY . . +RUN pip install -r requirements.txt +RUN python manage.py migrate + + +EXPOSE 8000 +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1f8a082 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +default: build + $(MAKE) run + +run: + docker run --rm -p 8000:8000 --name jticker -v "$${PWD}:/ticker/" ticker + +build: + docker build -t ticker . + + +.PHONY: default build run