-
Notifications
You must be signed in to change notification settings - Fork 331
solution 1 #315
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 1 #315
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,26 @@ | ||
| ARG PYTHON_VERSION=3.8 | ||
| FROM python:${PYTHON_VERSION} as build | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY requirements.txt ./ | ||
|
|
||
| RUN python -m venv /opt/venv && \ | ||
| /opt/venv/bin/pip install --upgrade pip && \ | ||
| /opt/venv/bin/pip install -r requirements.txt | ||
|
|
||
| FROM python:${PYTHON_VERSION}-slim | ||
|
|
||
| ENV PYTHONUNBUFFERED=1 | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY --from=build /opt/venv /opt/venv | ||
|
|
||
| COPY . ./ | ||
|
|
||
| RUN /opt/venv/bin/python manage.py migrate | ||
|
|
||
| EXPOSE 8080 | ||
|
|
||
| ENTRYPOINT ["/opt/venv/bin/python", "manage.py", "runserver", "0.0.0.0:8080"] | ||
|
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 implementation satisfies the task: it defines a build and run stage, uses |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| link to the [dockerhub repo](https://hub.docker.com/repository/docker/alexey211204/todoapp/general) | ||
|
|
||
| buildeing image | ||
| ```bash | ||
| docker build -f Dockerfile . -t todoapp:1.0.0 | ||
| ``` | ||
| runnung docker container from the image | ||
| ```bash | ||
| docker run -e ENV=TRUE -p 8080:8080 todoapp:1.0.0 | ||
| ``` | ||
|
|
||
| Open http://localhost:8080/ in your browser |
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 instructions cover building and running the image, and include a Docker Hub link, but they are missing the required explanation of how to access the app via a browser (e.g.
Open http://localhost:8080/). Add a brief line about the browser URL to fully meet the task requirements.