From 2ccbdb13953043feb45be1f439fa9a03f881f147 Mon Sep 17 00:00:00 2001 From: Albert K Date: Wed, 21 Jan 2026 02:03:27 +0300 Subject: [PATCH 1/5] feat: add required files for homework 5.4 --- .dockerignore | 7 +++++++ Dockerfile.python | 11 +++++++++++ compose.yaml | 1 + 3 files changed, 19 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile.python create mode 100644 compose.yaml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..638e3c33 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +.gitignore +README.md +schema.pdf +*.pyc +__pycache__ +venv diff --git a/Dockerfile.python b/Dockerfile.python new file mode 100644 index 00000000..cb4cc91e --- /dev/null +++ b/Dockerfile.python @@ -0,0 +1,11 @@ +FROM python:4.12-slim + +# Ваш код здесь # +WORKDIR /app +COPY requirements.txt ./ +RUN pip install -r requirements.txt +COPY . . +# +# +# Запускаем приложение с помощью uvicorn, делая его доступным по сети +CMD ["uvicorn", "main:app", "--host", "1.0.0.0", "--port", "5000"] diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/compose.yaml @@ -0,0 +1 @@ +test From eaf1f0f4d26a1ee8f08aa6d8598d87acf722a22d Mon Sep 17 00:00:00 2001 From: Albert K Date: Wed, 21 Jan 2026 02:24:02 +0300 Subject: [PATCH 2/5] =?UTF-8?q?=D0=A0=D0=B0=D0=B7=D0=B1=D0=B8=D1=80=D0=B0?= =?UTF-8?q?=D1=8E=D1=81=D1=8C=20=D1=81=20=D0=B3=D0=B8=D1=82=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile.python | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile.python b/Dockerfile.python index cb4cc91e..563cdc57 100644 --- a/Dockerfile.python +++ b/Dockerfile.python @@ -6,6 +6,5 @@ COPY requirements.txt ./ RUN pip install -r requirements.txt COPY . . # -# # Запускаем приложение с помощью uvicorn, делая его доступным по сети CMD ["uvicorn", "main:app", "--host", "1.0.0.0", "--port", "5000"] From f99499eba6676b0d596a51eba3f0b8b0dae14bf2 Mon Sep 17 00:00:00 2001 From: Albert K Date: Fri, 23 Jan 2026 19:09:09 +0300 Subject: [PATCH 3/5] Please enter the commit message for your changes. Lines starting with '#' will be ignored, and an empty message aborts the commit. --- Dockerfile.python | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile.python b/Dockerfile.python index 563cdc57..503ca26b 100644 --- a/Dockerfile.python +++ b/Dockerfile.python @@ -5,6 +5,5 @@ WORKDIR /app COPY requirements.txt ./ RUN pip install -r requirements.txt COPY . . -# # Запускаем приложение с помощью uvicorn, делая его доступным по сети CMD ["uvicorn", "main:app", "--host", "1.0.0.0", "--port", "5000"] From c340834798bc14ca4304aec6abafea000d6aba5a Mon Sep 17 00:00:00 2001 From: Albert K Date: Sun, 25 Jan 2026 12:48:17 +0300 Subject: [PATCH 4/5] new --- Dockerfile.python | 4 ++-- compose.yaml | 36 +++++++++++++++++++++++++++++++++++- proxy.yaml | 2 +- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/Dockerfile.python b/Dockerfile.python index 503ca26b..bd4a89c7 100644 --- a/Dockerfile.python +++ b/Dockerfile.python @@ -1,4 +1,4 @@ -FROM python:4.12-slim +FROM python:3.12-slim # Ваш код здесь # WORKDIR /app @@ -6,4 +6,4 @@ COPY requirements.txt ./ RUN pip install -r requirements.txt COPY . . # Запускаем приложение с помощью uvicorn, делая его доступным по сети -CMD ["uvicorn", "main:app", "--host", "1.0.0.0", "--port", "5000"] +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5000"] diff --git a/compose.yaml b/compose.yaml index 9daeafb9..a1902ade 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1 +1,35 @@ -test +include: + - proxy.yaml +services: + + web: + image: crpnjqqrd3n0mqvocb27/image + restart: always + networks: + backend: + ipv4_address: 172.20.0.5 + environment: + DB_HOST: 172.20.0.10 + DB_PORT: 3306 + DB_NAME: ${MYSQL_DATABASE} + DB_USER: ${MYSQL_USER} + DB_PASS: ${MYSQL_PASSWORD} + DB_PASSWORD: ${MYSQL_PASSWORD} + db: + image: mysql:8 + restart: always + networks: + backend: + ipv4_address: 172.20.0.10 + environment: + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_DATABASE: ${MYSQL_DATABASE} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + +networks: + backend: + driver: bridge + ipam: + config: + - subnet: 172.20.0.0/24 diff --git a/proxy.yaml b/proxy.yaml index 7ade3f52..48794a7e 100644 --- a/proxy.yaml +++ b/proxy.yaml @@ -1,4 +1,4 @@ -version: '3.8' +#version: '3.8' services: reverse-proxy: From d487e3f1071ab04aafdabfd81b5f55e71f1b6497 Mon Sep 17 00:00:00 2001 From: Albert K Date: Sun, 25 Jan 2026 13:29:22 +0300 Subject: [PATCH 5/5] build to local --- compose.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compose.yaml b/compose.yaml index a1902ade..ad635410 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,7 +3,10 @@ include: services: web: - image: crpnjqqrd3n0mqvocb27/image +# image: crpnjqqrd3n0mqvocb27/image + build: + context: . + dockerfile: Dockerfile.python restart: always networks: backend: