From 1682e7075899ce5dedc968e3610ab88d785d63d5 Mon Sep 17 00:00:00 2001 From: 1ntact Date: Tue, 9 Jun 2026 18:25:25 +0200 Subject: [PATCH 1/3] Add Dockerfile and INSTRUCTION.md --- Dockerfile | 25 +++++++++++++++++++++++++ INSTRUCTION.md | 17 +++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 Dockerfile create mode 100644 INSTRUCTION.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f977f10 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ + +ARG PYTHON_VERSION=3.8 +FROM python:${PYTHON_VERSION} AS builder + +WORKDIR /app + +COPY requirements.txt . +RUN pip install -r requirements.txt + + +ARG PYTHON_VERSION=3.8 +FROM python:${PYTHON_VERSION} + +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages +COPY . . + +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..e5393ab --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,17 @@ +# ToDo App — Docker Instructions + +## Docker Hub +https://hub.docker.com/r/1ntact/todoapp + +## Build the image +```bash +docker build -t todoapp . +``` + +## Run the container +```bash +docker run -d -p 8080:8080 --name todoapp 1ntact/todoapp:1.0.0 +``` + +## Access the application +Open your browser and go to: http://localhost:8080 \ No newline at end of file From 866a33dc140aade78375185007e8101aa01915c5 Mon Sep 17 00:00:00 2001 From: 1ntact Date: Tue, 9 Jun 2026 18:29:52 +0200 Subject: [PATCH 2/3] Done! --- .idea/.gitignore | 5 +++++ .idea/devops_todolist.iml | 14 ++++++++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 6 files changed, 45 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 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/devops_todolist.iml b/.idea/devops_todolist.iml new file mode 100644 index 0000000..2c9e7b9 --- /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..f9f303a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ 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 From a7197a7af17a0f19e4f4d9e957b69e89e55fdc77 Mon Sep 17 00:00:00 2001 From: 1ntact Date: Tue, 9 Jun 2026 18:35:20 +0200 Subject: [PATCH 3/3] Fixed --- Dockerfile | 2 +- INSTRUCTION.md | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index f977f10..cb62d22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ ENV PYTHONUNBUFFERED=1 WORKDIR /app -COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages +COPY --from=builder /usr/local/lib /usr/local/lib COPY . . RUN python manage.py migrate diff --git a/INSTRUCTION.md b/INSTRUCTION.md index e5393ab..d728e0b 100644 --- a/INSTRUCTION.md +++ b/INSTRUCTION.md @@ -4,14 +4,10 @@ https://hub.docker.com/r/1ntact/todoapp ## Build the image -```bash -docker build -t todoapp . -``` +docker build -t 1ntact/todoapp:1.0.0 . ## Run the container -```bash docker run -d -p 8080:8080 --name todoapp 1ntact/todoapp:1.0.0 -``` ## Access the application Open your browser and go to: http://localhost:8080 \ No newline at end of file