diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..956ac25 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +ARG PYTHON_VERSION=3.8 + +FROM python:${PYTHON_VERSION} as base + + +WORKDIR /app + +COPY . ./ + + +FROM python:${PYTHON_VERSION}-slim + +WORKDIR /app + +ENV PYTHONUNBUFFERED=1 + +COPY --from=base /app . + +RUN pip install --upgrade pip && \ + pip install -r requirements.txt && \ + python manage.py migrate + +EXPOSE 8080 + +ENTRYPOINT ["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..4ef47ff --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,22 @@ +## Docker Hub repository win an app image: +https://hub.docker.com/repository/docker/andriyshafran/todoapp/general + +## How to build image: +``` +docker build -t todoapp:1.0.0 . +``` + +## How to run container using local image: +``` +docker run -p 8080:8080 todoapp:1.0.0 +``` +# How to run container using image from DockerHub: +``` +docker run -p 8080:8080 andriyshafran/todoapp +``` + +## Access the application via a browser: + +``` +http://127.0.0.1:8080 +``` \ No newline at end of file