From 439e79ec6168a277f10f7e64d3630cd21820370b Mon Sep 17 00:00:00 2001 From: Oleksandr Kirichenko Date: Tue, 5 May 2026 22:39:00 +0300 Subject: [PATCH 1/4] Add Dockerfile and instructions --- .idea/.gitignore | 3 +++ .idea/devops_todolist.iml | 14 ++++++++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ Dockerfile | 15 +++++++++++++++ INSTRUCTION.md | 0 8 files changed, 56 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/devops_todolist.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 Dockerfile create mode 100644 INSTRUCTION.md diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..eaf91e2 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/devops_todolist.iml b/.idea/devops_todolist.iml new file mode 100644 index 0000000..5845e7a --- /dev/null +++ b/.idea/devops_todolist.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5923845 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..1639a67 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..c8397c9 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..89ce27e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +ARG PYTHON_VERSION=3.10 +FROM python:${PYTHON_VERSION}-slim + +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +RUN python manage.py migrate + +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..e69de29 From c6b81f8cf421f9785cb014cffa37fc8f82dea8a2 Mon Sep 17 00:00:00 2001 From: Oleksandr Kirichenko Date: Tue, 5 May 2026 22:43:40 +0300 Subject: [PATCH 2/4] Instructions file saved --- INSTRUCTION.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/INSTRUCTION.md b/INSTRUCTION.md index e69de29..0b54995 100644 --- a/INSTRUCTION.md +++ b/INSTRUCTION.md @@ -0,0 +1,13 @@ +# ToDo App Docker + +## Docker Hub +https://hub.docker.com/r/shvdw/todoapp + +## Build image +docker build -t todoapp . + +## Run container +docker run -p 8080:8080 todoapp + +## Open in browser +http://localhost:8080 \ No newline at end of file From 814ed65ec9a919382f77bf9c9e52de8714f446a0 Mon Sep 17 00:00:00 2001 From: Oleksandr Kirichenko Date: Wed, 6 May 2026 09:27:38 +0300 Subject: [PATCH 3/4] Fix multi-stage build and version tag --- Dockerfile | 16 ++++++++++++++-- INSTRUCTION.md | 12 ++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 89ce27e..5357ad4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,25 @@ ARG PYTHON_VERSION=3.10 -FROM python:${PYTHON_VERSION}-slim -ENV PYTHONUNBUFFERED=1 + +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 + +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + + +COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages +COPY --from=builder /usr/local/bin /usr/local/bin + COPY . . RUN python manage.py migrate diff --git a/INSTRUCTION.md b/INSTRUCTION.md index 0b54995..f22f0a8 100644 --- a/INSTRUCTION.md +++ b/INSTRUCTION.md @@ -1,13 +1,13 @@ # ToDo App Docker - -## Docker Hub -https://hub.docker.com/r/shvdw/todoapp - +https://hub.docker.com/repository/docker/shvdw/todoapp/general ## Build image -docker build -t todoapp . +docker build -t todoapp:1.0.0 . ## Run container -docker run -p 8080:8080 todoapp +docker run -p 8080:8080 todoapp:1.0.0 + +## Docker Hub +docker push shvdw/todoapp:1.0.0 ## Open in browser http://localhost:8080 \ No newline at end of file From b3d72ec6c0ffea7579fe3fc8260d728d876bd565 Mon Sep 17 00:00:00 2001 From: Oleksandr Kirichenko Date: Wed, 6 May 2026 13:47:51 +0300 Subject: [PATCH 4/4] remove .idea files --- .idea/.gitignore | 3 --- .idea/devops_todolist.iml | 14 -------------- .idea/inspectionProfiles/profiles_settings.xml | 6 ------ .idea/misc.xml | 4 ---- .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 6 files changed, 41 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/devops_todolist.iml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index eaf91e2..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/devops_todolist.iml b/.idea/devops_todolist.iml deleted file mode 100644 index 5845e7a..0000000 --- a/.idea/devops_todolist.iml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 5923845..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 1639a67..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index c8397c9..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file