diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4c2fc2b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +#base image + +From python:3.7 + +#working directory + +WORKDIR /app + +#code copy + +COPY . . + +#install libraries + +RUN pip install -r requirements.txt + +#migrate + +RUN python cool_counters/manage.py migrate + +#cmd + +CMD ["python","cool_counters/manage.py","runserver","0.0.0.0:8000"] + + diff --git a/README.md b/README.md index 12f40e6..24a599d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Simple Django App -This is a simple, minimal Django app intended to help understand the main aspects of working with Django. +This is a simple, minimal Django app intended to help you understand the main aspects of working with Django. ## Usage Instructions Clone this repository e.g. @@ -25,3 +25,12 @@ python manage.py runserver ``` Navigate to to http://127.0.0.1:8000 + +To create the docker image, run: + +docker build -t counter-app . + +To run the docker image, run: + +docker run -d -p 8000:8000 counter-app:latest + diff --git a/cool_counters/cool_counters/settings.py b/cool_counters/cool_counters/settings.py index 860bd04..66fcc40 100644 --- a/cool_counters/cool_counters/settings.py +++ b/cool_counters/cool_counters/settings.py @@ -25,7 +25,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ["*"] # Application definition diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d3e4ba5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +django