diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..ea7ed09 --- /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..36d4ae6 --- /dev/null +++ b/.idea/devops_todolist.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..c52c0f4 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,17 @@ + + + + \ 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..c86c7ab --- /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..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..c477314 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +ARG PYTHON_VERSION=3.12-slim + + +FROM python:${PYTHON_VERSION} AS build + +WORKDIR /devops_todolist + +ENV PYTHONUNBUFFERED=1 + +COPY requirements.txt . + +RUN pip install --no-cache-dir --prefix=/install -r requirements.txt + + + +FROM python:${PYTHON_VERSION} AS run + +WORKDIR /devops_todolist + +ENV PYTHONUNBUFFERED=1 + +COPY --from=build /install /usr/local + +COPY . . + +EXPOSE 8080 + +CMD ["sh", "-c", "python manage.py migrate && 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..1087527 --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,4 @@ +Repo: https://hub.docker.com/repository/docker/midandnight/todoapp/general +Build: docker build -t midandnight/todoapp:1.0.0 . +Run: docker run -p 8080:8080 midandnight/todoapp:1.0.0 +Open: http://localhost:8080 \ No newline at end of file