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
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION} AS build

WORKDIR /app

COPY . .

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

RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt


FROM python:${PYTHON_VERSION}-slim AS run

WORKDIR /app
ENV 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 show building the image as todoapp without a version tag; since the description explicitly calls for pushing todoapp:1.0.0 to Docker Hub, consider adding a build example with that tag (e.g., docker build -t todoapp:1.0.0 .) to fully reflect checklist item #10.

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 checklist requires building and pushing an image named todoapp with tag 1.0.0 (todoapp:1.0.0), but this build command omits the version tag. Consider changing the example to include the tag, e.g. docker build -t todoapp:1.0.0 ., so it aligns with the Docker Hub image and the task requirements.


COPY --from=build /app /app

ENV PATH="/app/venv/bin:$PATH"
RUN python manage.py migrate

EXPOSE 8080

ENTRYPOINT ["python", "manage.py", "runserver"]
CMD ["0.0.0.0:8080"]
48 changes: 48 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# ToDo App — Docker Instructions

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using ARG PYTHON_VERSION=3.14 may break the build because python:3.14 / python:3.14-slim images are not available yet. The requirements only state Python 3.8+; consider switching to a stable tag like 3.10 or 3.11 so docker build reliably works (checklist item #1 and #4).


## Docker Hub Repository

The image is available on Docker Hub:
https://hub.docker.com/r/olehkovalievskyi/todoapp

## Prerequisites

- Docker installed on your machine
- (Optional) Docker Hub account, if you want to pull the pre-built image

## Build the image locally

Clone the repository and navigate to its root directory, then run:

```bash
docker build -t todoapp:1.0.0 .
```

## Run the container

```bash
docker run -d -p 8080:8080 --name todoapp-container todoapp:1.0.0
```

Alternatively, you can pull and run the pre-built image directly from Docker Hub:

```bash
docker pull olehkovalievskyi/todoapp:1.0.0
docker run -d -p 8080:8080 --name todoapp-container olehkovalievskyi/todoapp:1.0.0
```

## Stopping the container

```bash
docker stop todoapp-container
```

## Access the application

Once the container is running, open your browser and navigate to:

http://localhost:8080

## Notes

- The application listens on `0.0.0.0:8080` inside the container.
Loading