sd
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user