-
Notifications
You must be signed in to change notification settings - Fork 305
solution #299
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 #299
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,14 @@ | ||
| ARG python_version=3.8 | ||
| FROM python:${python_version} AS builder | ||
| WORKDIR /app | ||
| COPY requirements.txt . | ||
| RUN pip install --no-cache-dir --prefix=/install -r requirements.txt | ||
|
|
||
| FROM python:${python_version} | ||
| WORKDIR /app | ||
| COPY --from=builder /install /usr/local | ||
| COPY . . | ||
| RUN python manage.py migrate | ||
| ENV PYTHONUNBUFFERED=1 | ||
| 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,13 @@ | ||
| # Django ToDo App | ||
| ## Docker Hub | ||
| [Link to your Docker Hub repository](https://hub.docker.com/r/1hitori1/devops_todolist) | ||
| ## Building and Running | ||
| ### Build the image | ||
| ```bash | ||
| docker build -t todoapp . | ||
|
Comment on lines
+1
to
+7
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 INSTRUCTION.md file is incomplete. It's missing instructions for running the container and instructions for accessing the application via browser, which are required by task items #12 and #13. Add: 1) |
||
| ``` | ||
|
|
||
| ### Run the container | ||
| ```bash | ||
| docker run -p 8080:8080 todoapp | ||
| ``` | ||
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 must contain both a build stage and a run stage (multi-stage build) as required by task item #3. Currently, there's only a single FROM statement. Add a build stage (e.g.,
FROM python:3.8-slim AS builder) and a separate run stage (e.g.,FROM python:3.8-slim) to copy only the necessary artifacts.