-
Notifications
You must be signed in to change notification settings - Fork 303
Solution #284
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 #284
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ARG PYTHON_VERSION=3.12 | ||
|
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. Dockerfile uses ARG PYTHON_VERSION and multi-stage build which is good, but the resulting image name required by the task must be |
||
| FROM python:${PYTHON_VERSION}-slim AS build | ||
|
|
||
|
Comment on lines
+1
to
+3
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. The Dockerfile includes the required ARG for Python base image (meets checklist #7) and defines a two-stage build (build + run) which satisfies the build/run stage requirement (#6). However there are a few issues to fix:
|
||
| WORKDIR /build | ||
|
|
||
|
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. INSTRUCTION.md still uses local runserver without the required host/port. The task requires
Comment on lines
+1
to
+5
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. INSTRUCTION.md local setup is missing an explicit statement that Python 3.8+ is required (you have a brief note but it should be explicit in the local steps) and must list the exact commands required by the task: |
||
| COPY requirements.txt . | ||
| COPY . . | ||
|
|
||
|
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. INSTRUCTION.md links to DockerHub but does not contain the full build/push commands to the personal repository. Add exact commands such as:
|
||
| FROM python:${PYTHON_VERSION}-slim as run | ||
|
|
||
|
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. INSTRUCTION.md currently uses the image tag 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. The Dockerfile uses ARG and multi-stage build (good) but the assignment requires the image be named 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. INSTRUCTION.md lists |
||
| ENV PYTHONUNBUFFERED=1 | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY --from=build /build /app | ||
|
Comment on lines
+6
to
+15
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. The Dockerfile copies the entire repository into /build in the build stage, then copies it into /app. But |
||
|
|
||
| RUN pip install --no-cache-dir -r requirements.txt | ||
| RUN python manage.py migrate | ||
|
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. Dockerfile runs 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. Dockerfile runs migrations at build time which can fail if the image build doesn't have writable DB or proper DB config. The task allows running migrations during build only if it will work with SQLite — ensure the project uses SQLite by default or move migrations to container start and document the approach in INSTRUCTION.md (checklist requires either ensuring SQLite works at build or documenting DB configuration). 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. The Dockerfile runs |
||
|
|
||
| CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| DockerHub - https://hub.docker.com/repository/docker/vanyas627/todoapp/general | ||
|
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. The Dockerfile includes ARG PYTHON_VERSION and uses it in both stages — this satisfies checklist item #7. Good. 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. INSTRUCTION.md includes a Docker Hub link which satisfies checklist item #12, but it points to |
||
|
|
||
|
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. The Dockerfile meets several checklist items but is missing a build stage separation: the build stage copies the entire repo into /build and later RUN pip install is executed in the run stage — functional but suboptimal. More importantly, checklist item #10 requires building an image named |
||
| Image: docker build -t todoapp:1.0 | ||
|
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. INSTRUCTION.md's build step should specify the exact commands required by the task: use Python 3.8+ locally to run |
||
|
|
||
| Run Container: docker run -p 8080:8080 todoapp:1.0 | ||
|
|
||
| Open the app in browser: http://localhost:8080 | ||
|
Comment on lines
+3
to
+14
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. INSTRUCTION.md local setup must explicitly state Python 3.8+ is required and must list the exact commands and URLs from the checklist. Currently you have them but be explicit about URLs for both web UI and 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.
INSTRUCTION.md is missing the
docker pushcommand to push the built image to your Docker Hub repo (todoapp:1.0.0) as required by checklist item #11 and it's missing explicit instructions to build with the ARG or specify Python version if needed. Add exact commands such asdocker build -t yourdockerhubusername/todoapp:1.0.0 .anddocker push yourdockerhubusername/todoapp:1.0.0. Also ensure you instruct to run with-p 8080:8080and explain the URL (you already have that).