This commit is contained in:
ilyastar9999
2025-12-02 19:47:32 +03:00
parent 30e923578c
commit d137f66314
2 changed files with 7 additions and 3 deletions

View File

@@ -110,10 +110,14 @@ async def create_service(service: ServiceCreate):
if not os.path.exists(service_path):
raise HTTPException(status_code=404, detail=f"Service path not found: {service_path}")
# Check if docker-compose.yml exists
# Check if docker-compose file exists (yml or yaml)
compose_file = os.path.join(service_path, "docker-compose.yml")
if not os.path.exists(compose_file):
raise HTTPException(status_code=404, detail=f"docker-compose.yml not found in {service_path}")
compose_file = os.path.join(service_path, "docker-compose.yaml")
if not os.path.exists(compose_file):
compose_file = os.path.join(service_path, "compose.yml")
if not os.path.exists(compose_file):
raise HTTPException(status_code=404, detail=f"docker-compose file not found in {service_path}")
service_id = await conn.fetchval(
"INSERT INTO services (name, path, git_url, status) VALUES ($1, $2, $3, $4) RETURNING id",