From 7e6d478a8beabcc64ed1749f681767ea71c33695 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Sun, 19 Aug 2018 11:59:03 -0400 Subject: [PATCH] Rebase off master with updated Dockerfile --- Dockerfile | 2 ++ README.md | 8 +++++++- docker-compose.yml | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index ba2da75..3c62c0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,8 @@ COPY --from=builder /home/python /home/python COPY --from=builder /lib /lib COPY --from=builder /usr/lib /usr/lib +STOPSIGNAL SIGINT ENTRYPOINT ["venv/bin/python"] ENV DJANGO_SETTINGS_MODULE=get_together.environ_settings CMD ["manage.py", "runserver", "0.0.0.0:8000"] + diff --git a/README.md b/README.md index f7eeb5d..9cdeb8e 100644 --- a/README.md +++ b/README.md @@ -63,13 +63,19 @@ file): `./env/bin/python manage.py load_cities cities15000.txt` -### Using the docker container +### Using docker ``` docker build -t get_together . docker run -e "DEBUG_MODE=True" -e "SECRET_KEY=xxxxx" -e "ALLOWED_HOSTS=localhost,127.0.0.1" -d --name get_together -p 8000:8000 get_together docker exec -it get_together python3 manage.py createsuperuser ``` +### Using docker-compose +``` +docker-compose up -d +docker-compose exec get_together python3 manage.py createsuperuser +``` + You can then connect to the container by going to localhost:8000 ## Test Federation diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..17c265e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3' +services: + get_together: + build: + context: . + dockerfile: Dockerfile + stdin_open: true + tty: true + ports: + - "8000:8000" + environment: + - DEBUG_MODE=True + - SECRET_KEY=xxxxx + - ALLOWED_HOSTS=localhost,127.0.0.1