From 4c499cd1c6131987e3b67b6d9657f156d49d24a8 Mon Sep 17 00:00:00 2001 From: Ivan Sotsenko Date: Tue, 21 Apr 2026 20:43:11 +0200 Subject: [PATCH 1/3] Solution --- .idea/.gitignore | 8 +++++ .idea/devops_todolist.iml | 32 +++++++++++++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++ .idea/misc.xml | 7 ++++ .idea/modules.xml | 8 +++++ .idea/vcs.xml | 6 ++++ Dockerfile | 20 ++++++++++++ INSTRUCTION.md | 7 ++++ 8 files changed, 94 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..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/devops_todolist.iml b/.idea/devops_todolist.iml new file mode 100644 index 0000000..8555590 --- /dev/null +++ b/.idea/devops_todolist.iml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + \ 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..4b96df2 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c3d91e6 --- /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..35eb1dd --- /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..a96f461 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +ARG PYTHON_VERSION=3.12 +FROM python:${PYTHON_VERSION}-slim AS build + +WORKDIR /build + +COPY requirements.txt . +COPY . . + +FROM python:${PYTHON_VERSION}-slim as run + +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +COPY --from=build /build /app + +RUN pip install --no-cache-dir -r requirements.txt +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..8153938 --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,7 @@ +DockerHub - https://hub.docker.com/repository/docker/vanyas627/todoapp/general + +Image: docker build -t todoapp:1.0 + +Run Container: docker run -p 8080:8080 todoapp:1.0 + +Open the app in browser: http://localhost:8080 \ No newline at end of file From 80ace12c8dc13a9995ab46fed68f16267b63b3a7 Mon Sep 17 00:00:00 2001 From: Ivan Sotsenko Date: Tue, 21 Apr 2026 20:57:26 +0200 Subject: [PATCH 2/3] Change INSTRUCTION.md --- INSTRUCTION.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/INSTRUCTION.md b/INSTRUCTION.md index 8153938..ea1a3d3 100644 --- a/INSTRUCTION.md +++ b/INSTRUCTION.md @@ -1,6 +1,13 @@ +Local Installation + +1) pip install -r requirements.txt +2) python manage.py migrate +3) python manage.py runserver + + DockerHub - https://hub.docker.com/repository/docker/vanyas627/todoapp/general -Image: docker build -t todoapp:1.0 +Image: docker build -t todoapp:1.0 . Run Container: docker run -p 8080:8080 todoapp:1.0 From 9c0ab8dea62bf30fbf54ee5c0f4706338d2f933e Mon Sep 17 00:00:00 2001 From: Ivan Sotsenko Date: Tue, 21 Apr 2026 21:21:36 +0200 Subject: [PATCH 3/3] Solution2 --- INSTRUCTION.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/INSTRUCTION.md b/INSTRUCTION.md index ea1a3d3..fbbe0ec 100644 --- a/INSTRUCTION.md +++ b/INSTRUCTION.md @@ -1,14 +1,14 @@ -Local Installation +Local Installation(Use Python 3.8+) 1) pip install -r requirements.txt 2) python manage.py migrate -3) python manage.py runserver +3) python manage.py runserver 0.0.0.0:8080 DockerHub - https://hub.docker.com/repository/docker/vanyas627/todoapp/general -Image: docker build -t todoapp:1.0 . +Image: docker build -t vanyas627/todoapp:1.0.0 . -Run Container: docker run -p 8080:8080 todoapp:1.0 +Run Container: docker run -p 8080:8080 vanyas627/todoapp:1.0.0 Open the app in browser: http://localhost:8080 \ No newline at end of file