Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Dockerfile
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 ./

Copy link
Copy Markdown

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.

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"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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 ARG for Python version, sets ENV PYTHONUNBUFFERED=1, runs migrations in a RUN command, and starts Django with runserver 0.0.0.0:8080. No functional changes are needed here based on the description.

12 changes: 12 additions & 0 deletions accounts/INSTRUCTION.md
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
Loading