-
Notifications
You must be signed in to change notification settings - Fork 332
<building and running the container> #321
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?
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,15 @@ | ||
| ARG PYTHON_VERSION=3.8 | ||
| FROM python:${PYTHON_VERSION} AS builder | ||
| WORKDIR /app | ||
| COPY requirements.txt . | ||
| RUN pip install --no-cache-dir -r requirements.txt | ||
| COPY . . | ||
| RUN python manage.py migrate | ||
|
|
||
| FROM python:3.8-slim | ||
| ENV PYTHONUNBUFFERED=1 | ||
| WORKDIR /app | ||
| COPY --from=builder /app . | ||
| 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,12 @@ | ||
|
|
||
|
|
||
| # ToDo App Docker Image | ||
| ## Docker Hub | ||
| https://hub.docker.com/repository/docker/margarita8454/todoapp/general | ||
| ## Запуск | ||
|
Comment on lines
+3
to
+6
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. |
||
|
|
||
| docker pull margarita8454/todoapp:1.0.0 | ||
| docker run -d -p 8080:8080 margarita8454/todoapp:1.0.0 | ||
| docker build -t todoapp:1.0.0 . | ||
|
Comment on lines
+8
to
+10
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 instructions list the correct |
||
|
|
||
| ## How to access the app in the browser => http://localhost:8080/ | ||
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 task explicitly requires the Dockerfile to have both a build stage and a run stage (multi-stage build), but this file only defines a single stage; consider adding a separate
FROMfor a final runtime stage and using this one as the builder (checklist item #2).