-
Notifications
You must be signed in to change notification settings - Fork 310
'Solution' #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
'Solution' #310
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| 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"] | ||
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| 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/ | ||
There was a problem hiding this comment.
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.