From 7adabce7daa38cd8f060a708f95a7e280da6f050 Mon Sep 17 00:00:00 2001 From: Xanders25 Date: Thu, 19 Dec 2024 03:31:58 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20docker-compose.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6a26ce0..afb5e76 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,28 +1,25 @@ -version: "3.8" - services: git_cloner: image: alpine/git volumes: - - /home/blues/py:/repo # Монтируем целевую папку + - /data/py:/repo command: > sh -c " - mkdir -p /repo && # Убедимся, что папка существует if [ ! -d /repo/.git ]; then git clone https://git.xander.cx.ua/Xanders25/test_compos.git /repo && echo 'Repository cloned'; else echo 'Repository already exists'; - fi; " + fi; + " app: build: - context: /home/blues/py # Используем клонированный репозиторий для сборки - dockerfile: Dockerfile + context: /data/py + dockerfile: Dockerfile working_dir: /app command: python app.py ports: - - "5000:5000" # Пробрасываем порт + - "5000:5000" depends_on: - git_cloner - restart: always