Skip to content
Closed
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
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG PYTHON_VERSION=3.13-slim
FROM python:${PYTHON_VERSION} AS builder
WORKDIR /build

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

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 must include how to build the image and run the container, but currently you only show a docker run command. Add steps for building (e.g., docker build -t todoapp .), tagging as todoapp:1.0.0, and pushing to Docker Hub so you cover the full workflow required by the task.


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

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 requirements state that the image must be pushed as todoapp:1.0.0 to your personal Docker Hub repository. This run command uses :latest instead of the required 1.0.0 tag, and doesn’t show the expected local image name todoapp. Update this example to use your-namespace/todoapp:1.0.0 and ensure it matches how you build/tag the image.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here you build the image as todoapp:1.0.0, which matches the requirement to build an image named todoapp, but later you run 666phx/todoapp:1.0.0 without explaining how that tag was created; consider either building directly as 666phx/todoapp:1.0.0 or adding explicit docker tag/docker push steps so the workflow is consistent with the requirement to push <your-namespace>/todoapp:1.0.0 to Docker Hub.



FROM python:${PYTHON_VERSION} AS runtime
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 app is supposed to run on port 8080 (per the required runserver 0.0.0.0:8080), but here you tell users to access port 8000. Once you fix the Dockerfile to use 8080, update this URL to http://localhost:8080 so the instructions match the actual container behavior.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This docker run command uses 666phx/todoapp:1.0.0 even though the build step only created todoapp:1.0.0; update this to match the image you build (or document the tagging step) so users can actually run the container as described and the instructions align with the required <your-namespace>/todoapp:1.0.0 tag.

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

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 Docker Hub link should point to the repository/image that contains the required todoapp:1.0.0 tag. Verify that this URL matches your personal repo with that tag and, if necessary, adjust the text to reference the 1.0.0 image explicitly.

COPY . .

RUN python manage.py migrate

ENTRYPOINT ["python"]
CMD ["manage.py", "runserver", "0.0.0.0:8080"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since the requirement is to push the todoapp:1.0.0 image to your personal Docker Hub, it would be helpful to mention that the exact image tag available at this link is 666phx/todoapp:1.0.0, and ensure that tag is what you use in your docker run example.

32 changes: 32 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# How to run the app

## 1. Install Docker

Download and install Docker for your OS: https://docs.docker.com/get-docker/

## 2. Build the image

```
docker build -t todoapp:1.0.0 .

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 building an image named todoapp and pushing it to your personal Docker Hub as <namespace>/todoapp:1.0.0; your local build command is fine, but you don’t document tagging and pushing to 666phx/todoapp:1.0.0, which is part of the required workflow.

```

## 3. Tag and push to Docker Hub

```
docker tag todoapp:1.0.0 666phx/todoapp:1.0.0
docker push 666phx/todoapp:1.0.0
```

## 4. Run the container

```
docker run -d -p 8080:8080 666phx/todoapp:1.0.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here you run 666phx/todoapp:1.0.0, but you never showed how to tag/push todoapp:1.0.0 as 666phx/todoapp:1.0.0; consider adding explicit docker tag and docker push commands so the instructions fully match the requirement to publish this exact image/tag.

```

## 5. Open in browser

Go to: http://localhost:8080

---

Docker Hub image: https://hub.docker.com/r/666phx/todoapp/tags
Loading