diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ee6480c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# Build stage +ARG PYTHON_VERSION=3.8 +FROM python:${PYTHON_VERSION} AS base +WORKDIR /app +COPY . . +# Runtime stage +FROM python:${PYTHON_VERSION}-slim +WORKDIR /app +ENV PYTHONUNBUFFERED=1 +COPY --from=base /app . +RUN pip install --upgrade pip && \ +pip install -r requirements.txt +RUN python manage.py migrate +EXPOSE 8080 +CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"] \ No newline at end of file diff --git a/INSTRUCTION.md b/INSTRUCTION.md new file mode 100644 index 0000000..ff65309 --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,8 @@ +Link to my personal Docker Hub repository win an app image: +https://hub.docker.com/repository/docker/nook17n1/todoapp/tags/1.0.0/sha256-e1ae24b5f1dd0effb9631055de04b8677dcc991802429512b18f97d42aacffa3 + +Instructions for building and running the container. +1. docker build -t todoapp:1.0.0 . +2. docker run -d -p 8080:8080 --name app todoapp:1.0.0 + +And then start the server in your browser (default is http://localhost:8080). \ No newline at end of file