From bc0a124399bb4f206ea94ad16143a58d27593852 Mon Sep 17 00:00:00 2001 From: Foxytail8 Date: Thu, 4 Jun 2026 16:20:08 +0300 Subject: [PATCH 1/2] 'Solution' --- Dockerfile | 9 +++++++++ INSTRUCTION.md | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 Dockerfile create mode 100644 INSTRUCTION.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4d19b72 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +ARG PYTHON_VERSION=3.10 +FROM python:${PYTHON_VERSION}-slim +WORKDIR /app +COPY . . +RUN pip install --no-cache-dir -r requirements.txt +ENV PYTHONUNBUFFERED=1 +RUN python manage.py migrate +EXPOSE 8080 +CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"] diff --git a/INSTRUCTION.md b/INSTRUCTION.md new file mode 100644 index 0000000..cfbf717 --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,7 @@ +Application todoapp is located in +https://hub.docker.com/repository/docker/foxytail8/todoapp + +You need download conteiner and run with command +docker run -p 8080:8080 todoapp:1.0.0 + +Then you open in brouser page http://localhost:8080 or http:localhost:8080/api/ From 64a792078666115fbeb7be313f0a62ce4cd494d1 Mon Sep 17 00:00:00 2001 From: Foxytail8 Date: Thu, 4 Jun 2026 16:31:55 +0300 Subject: [PATCH 2/2] 'Solution2' --- Dockerfile | 4 ++++ INSTRUCTION.md | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4d19b72..e3968e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,8 @@ ARG PYTHON_VERSION=3.10 +FROM python:${PYTHON_VERSION}-slim AS builder +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt FROM python:${PYTHON_VERSION}-slim WORKDIR /app COPY . . diff --git a/INSTRUCTION.md b/INSTRUCTION.md index cfbf717..7f13758 100644 --- a/INSTRUCTION.md +++ b/INSTRUCTION.md @@ -1,7 +1,10 @@ Application todoapp is located in https://hub.docker.com/repository/docker/foxytail8/todoapp -You need download conteiner and run with command +For build container run command +docker build -t todoapp:1.0.0 . + +You need download container and run with command docker run -p 8080:8080 todoapp:1.0.0 -Then you open in brouser page http://localhost:8080 or http:localhost:8080/api/ +Then you open in browser page http://localhost:8080 or http://localhost:8080/api/