Docker setup for ToDo app#297
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The implementation has critical tag mismatches that violate explicit task requirements. Task requirement #8 requires the image to be named todoapp, and requirement #9 requires it to be tagged with 1.0.0. However, the Dockerfile and INSTRUCTION.md use verteiger/todoapp:latest throughout, which fails both requirements. You need to: (1) Change the build tag from -t verteiger/todoapp:latest to -t todoapp:1.0.0 in the Dockerfile, (2) Update all references in INSTRUCTION.md from todoapp:latest to todoapp:1.0.0 in build, run, tag, push commands, and docker-compose service, (3) Verify the Docker Hub repository name matches your actual account. The technical implementation (multi-stage build, ARG, ENV PYTHONUNBUFFERED=1, migration RUN, runserver with 0.0.0.0:8080) is correct, but the tag naming must be fixed to meet the requirements.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
|
|
||
| ### Runtime stage | ||
| FROM python:${PYTHON_VERSION}-slim | ||
|
|
There was a problem hiding this comment.
The image is built with tag verteiger/todoapp:latest but task requirement #8 specifies it should be named todoapp. Change -t verteiger/todoapp:latest to -t todoapp:1.0.0 to match the requirement.
| gcc \ | ||
| python3-dev \ | ||
| libbz2-dev \ | ||
| libssl-dev \ |
There was a problem hiding this comment.
The image tag mentioned is latest but task requirement #9 requires the image to be pushed with 1.0.0 tag (todoapp:1.0.0). Update all references from latest to 1.0.0.
|
|
||
| WORKDIR /app | ||
|
|
||
| # Create non-root user |
There was a problem hiding this comment.
Image tag should be 1.0.0 instead of latest to match task requirement #9.
| RUN chown -R appuser:appuser /app | ||
|
|
||
| # Switch to non-root user | ||
| USER appuser |
There was a problem hiding this comment.
Image tag should be 1.0.0 instead of latest to match task requirement #9.
|
|
||
| RUN python manage.py migrate | ||
|
|
||
| # Application port |
There was a problem hiding this comment.
Image tag should be 1.0.0 instead of latest to match task requirement #9.
| docker pull verteiger/todoapp:latest | ||
|
|
||
| 2. Run the container, mapping the container port 8080 to a host port (example uses host port 8000): | ||
|
|
There was a problem hiding this comment.
The pull command uses todoapp:latest but should reference todoapp:1.0.0 to match the task requirement for the specific tag.
| docker build -t verteiger/todoapp:latest . | ||
|
|
||
| 2. Run the locally-built image: | ||
|
|
There was a problem hiding this comment.
The run command uses todoapp:latest but should use todoapp:1.0.0 to match the specified tag in the task requirements.
| docker login | ||
|
|
||
| 2. Tag the image (if needed): | ||
|
|
There was a problem hiding this comment.
The tag command uses todoapp:latest but should be todoapp:1.0.0 as specified in the task requirement.
| docker tag verteiger/todoapp:latest verteiger/todoapp:latest | ||
|
|
||
| 3. Push: | ||
|
|
There was a problem hiding this comment.
The push command uses todoapp:latest but should push todoapp:1.0.0 to match the task requirement.
| ```yaml | ||
| version: '3.8' | ||
| services: | ||
| todoapp: |
There was a problem hiding this comment.
The docker-compose service uses todoapp:latest image tag but should use todoapp:1.0.0 for consistency with the task requirement.
|
|
||
| FROM python:${PYTHON_VERSION}-slim AS builder | ||
|
|
||
| WORKDIR /app |
| gcc \ | ||
| python3-dev \ | ||
| libbz2-dev \ | ||
| libssl-dev \ |
|
|
||
| ### Runtime stage | ||
| FROM python:${PYTHON_VERSION}-slim | ||
|
|
|
|
||
| WORKDIR /app | ||
|
|
||
| # Create non-root user |
| RUN chown -R appuser:appuser /app | ||
|
|
||
| # Switch to non-root user | ||
| USER appuser |
| docker build -t verteiger/todoapp:latest . | ||
|
|
||
| 2. Run the locally-built image: | ||
|
|
| docker build -t verteiger/todoapp:latest . | ||
|
|
||
| 2. Run the locally-built image: | ||
|
|
| docker login | ||
|
|
||
| 2. Tag the image (if needed): | ||
|
|
| docker tag verteiger/todoapp:latest verteiger/todoapp:latest | ||
|
|
||
| 3. Push: | ||
|
|
| ```yaml | ||
| version: '3.8' | ||
| services: | ||
| todoapp: |
|
pls check |
|
@mateacademy-ai-mentor pls check |
No description provided.