-
Notifications
You must be signed in to change notification settings - Fork 331
feat: add Dockerfile and instruction #324
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,19 @@ | ||
| ARG PYTHON_VERSION=3.8 | ||
|
|
||
| FROM python:${PYTHON_VERSION} AS base | ||
|
|
||
| FROM python:${PYTHON_VERSION}-slim | ||
|
|
||
|
Comment on lines
+5
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. The Docker Hub requirement specifies the image should be pushed with tag |
||
| ENV PYTHONUNBUFFERED=1 | ||
|
|
||
| WORKDIR /app | ||
|
Comment on lines
+5
to
+9
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 mention how to build and run the container, but they do not explain tagging the image as |
||
|
|
||
| COPY requirements.txt . | ||
|
|
||
| RUN pip install --no-cache-dir -r requirements.txt | ||
|
|
||
| COPY . . | ||
|
Comment on lines
+13
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 description explicitly requires running database migrations as a |
||
|
|
||
| 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 Hub: https://hub.docker.com/r/iondan587/todoapp | ||
|
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. You declare a |
||
|
|
||
| ## Как собрать образ: | ||
| docker build --build-arg PYTHON_VERSION=3.10 -t todoapp . | ||
|
Comment on lines
+5
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. The Docker Hub link and basic instructions are good, but checklist item #20 expects full instructions for building and running the container consistent with the Dockerfile, including the fact that database migrations are handled via a |
||
|
|
||
| ## Как запустить контейнер: | ||
| docker run -p 8080:8080 todoapp | ||
|
|
||
| ## Как открыть в браузере: | ||
| Перейти по адресу 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 requires the Dockerfile to have a proper build stage and run stage (checklist #5), but here you only define a
basestage and then start a new unrelatedpython:${PYTHON_VERSION}-slimstage; consider explicitly using the build stage (e.g.FROM base AS buildthenFROM python:${PYTHON_VERSION}-slim AS runand copy artifacts frombuild).