diff --git a/compose/composetest/app.py b/compose/composetest/app.py index 5f80c1c..2be2e7c 100644 --- a/compose/composetest/app.py +++ b/compose/composetest/app.py @@ -10,6 +10,5 @@ def hello(): redis.incr('hits') return 'Hello World! I have been seen %s times.' % redis.get('hits') - if __name__ == "__main__": - app.run(host="0.0.0.0", debug=True) - \ No newline at end of file +if __name__ == "__main__": + app.run(host="0.0.0.0", debug=True) diff --git a/compose/django/.gitignore b/compose/django/.gitignore new file mode 100644 index 0000000..7cc5304 --- /dev/null +++ b/compose/django/.gitignore @@ -0,0 +1,2 @@ +composeexample +manage.py diff --git a/compose/django/Dockerfile b/compose/django/Dockerfile new file mode 100644 index 0000000..308974b --- /dev/null +++ b/compose/django/Dockerfile @@ -0,0 +1,11 @@ + +FROM python:2.7 + +# This environment variable force stdin, stdout and stderr to be totally unbuffered +ENV PYTHONUNBUFFERED 1 + +RUN mkdir /code +WORKDIR /code +ADD requirements.txt /code/ +RUN pip install -r requirements.txt +ADD . /code/ diff --git a/compose/django/docker-compose.yml b/compose/django/docker-compose.yml new file mode 100644 index 0000000..f5b68ed --- /dev/null +++ b/compose/django/docker-compose.yml @@ -0,0 +1,12 @@ + +db: + image: postgres +web: + build: . + command: python manage.py runserver 0.0.0.0:8000 + volumes: + - .:/code + ports: + - "8000:8000" + links: + - db diff --git a/compose/django/requirements.txt b/compose/django/requirements.txt new file mode 100644 index 0000000..a4a0ad6 --- /dev/null +++ b/compose/django/requirements.txt @@ -0,0 +1,2 @@ +Django +psycopg2