services: git_cloner: image: alpine/git volumes: - /data/py:/repo command: > sh -c " 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; " app: build: context: /data/py dockerfile: Dockerfile working_dir: /app command: python app.py ports: - "5000:5000" depends_on: - git_cloner