Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/devops_todolist.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG PYTHON_VERSION=3.9-slim

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task requires that the built image be named todoapp and pushed as todoapp:1.0.0; your Dockerfile does not enforce a tag, so ensure your build and push commands (documented in INSTRUCTION.md) clearly align with this requirement and mention the bare todoapp name if expected.

FROM python:${PYTHON_VERSION} AS builder

WORKDIR /app

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instructions use somewellich/todoapp:1.0.0, while the task says the image should be named todoapp and pushed as todoapp:1.0.0; update this section to explicitly align with the requirement (e.g., explain the namespace + repo naming and ensure it matches what the platform expects).

RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .
RUN python manage.py migrate

FROM python:${PYTHON_VERSION}

ENV PYTHONUNBUFFERED=1
ENV PATH="/opt/venv/bin:$PATH"

WORKDIR /app

COPY --from=builder /opt/venv /opt/venv
COPY --from=builder /app .

EXPOSE 8080

CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"]
26 changes: 26 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[Docker Image](https://hub.docker.com/r/somewellich/todoapp)

## Instructions for building and running the container

1. First, build the local image named exactly `todoapp`:
``` bash
docker build -t todoapp .
```
Next, we need to add a tag with the personal Docker Hub namespace.
Explanation: `todoapp` is the local image name. `somewellich/todoapp:1.0.0` is the namespaced repository tag required by Docker Hub to know where to upload the image and what version it is.

```bash
docker tag todoapp somewellich/todoapp:1.0.0
```
Run the container:

```bash
docker run -d -p 8080:8080 somewellich/todoapp:1.0.0
```
## Instructions on accessing the application via a browser

http://localhost:8080/

OR

[http://127.0.0.1:8080/](http://127.0.0.1:8080/)
Loading