From 33d2e6b05c0746011ad20ed640827824242ea0e0 Mon Sep 17 00:00:00 2001 From: akerele abraham Date: Fri, 27 Sep 2019 12:33:39 +0100 Subject: [PATCH] add: added dockerfile for docker build --- Dockerfile | 20 ++++++++++++++++++++ README.rst | 15 +++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6846601 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Use an official Python runtime as a parent image +FROM python:3.6 + +# Set the working directory to /app +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . /app + +CMD ["apt","install","python3-dev","python3-pip","python3-virtualenv","sqlitebrowser"] +# Install any needed packages specified in requirements.txt +RUN pip install -r requirements.txt + +# Make port 8000 available to the world outside this container +EXPOSE 8000 + +CMD ["python3","manage.py","migrate"] +# Run app.py when the container launches +CMD ["python3", "manage.py","runserver","0.0.0.0:8000"] + diff --git a/README.rst b/README.rst index cd6b10b..1c87433 100644 --- a/README.rst +++ b/README.rst @@ -104,3 +104,18 @@ the *Django Admin Interface* like this: :alt: Django Admin Interface running Django Admin Interface running + +Building with docker +==================== + +:: + + $ docker build --tag=helloworld . + +:: + + $ docker run -p 4000:8000 helloworld + +:: + + $ curl localhost:4000 \ No newline at end of file