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
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG PYTHON_VERSION=3.10
FROM python:${PYTHON_VERSION}-slim AS builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
FROM python:${PYTHON_VERSION}-slim
Comment on lines +1 to +6
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 Dockerfile currently has only ONE stage. Requirement #3 explicitly states the Dockerfile should contain a 'build stage and run stage' (multi-stage build). A multi-stage Dockerfile requires multiple FROM statements - typically one stage for building/compiling and a final stage for running the application. Please restructure to include both stages.

WORKDIR /app
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
ENV PYTHONUNBUFFERED=1
RUN python manage.py migrate
EXPOSE 8080
CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"]
10 changes: 10 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Application todoapp is located in
https://hub.docker.com/repository/docker/foxytail8/todoapp
Comment on lines +1 to +2
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CRITICAL: The Dockerfile is missing a multi-stage build structure. The requirements specify that the Dockerfile should contain a 'build stage' and 'run stage'. Currently, there's only a single FROM statement. A typical multi-stage Dockerfile would have two FROM statements - the first for building dependencies and a second, lighter FROM for the runtime stage.


For build container run command
docker build -t todoapp:1.0.0 .

You need download container and run with command
docker run -p 8080:8080 todoapp:1.0.0

Then you open in browser page http://localhost:8080 or http://localhost:8080/api/
Loading