From ed4e818765d6a95059166480ec879931314bb280 Mon Sep 17 00:00:00 2001 From: alexey211204 Date: Fri, 19 Jun 2026 19:32:30 +0200 Subject: [PATCH 1/2] solution 1 --- Dockerfile | 26 ++++++++++++++++++++++++++ accounts/INSTRUCTION.md | 10 ++++++++++ 2 files changed, 36 insertions(+) create mode 100644 Dockerfile create mode 100644 accounts/INSTRUCTION.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..200f87b --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/accounts/INSTRUCTION.md b/accounts/INSTRUCTION.md new file mode 100644 index 0000000..10d7ce9 --- /dev/null +++ b/accounts/INSTRUCTION.md @@ -0,0 +1,10 @@ +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 +``` \ No newline at end of file From 9c9b5f0d9da3db33e161a569ecfde2d343b7df99 Mon Sep 17 00:00:00 2001 From: alexey211204 Date: Fri, 19 Jun 2026 19:37:47 +0200 Subject: [PATCH 2/2] updated instruction.md --- accounts/INSTRUCTION.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accounts/INSTRUCTION.md b/accounts/INSTRUCTION.md index 10d7ce9..1ca1cf4 100644 --- a/accounts/INSTRUCTION.md +++ b/accounts/INSTRUCTION.md @@ -7,4 +7,6 @@ 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 -``` \ No newline at end of file +``` + +Open http://localhost:8080/ in your browser \ No newline at end of file