diff --git a/.env.example b/.env.example index ec84ff7..90c83c3 100644 --- a/.env.example +++ b/.env.example @@ -7,7 +7,7 @@ POSTGRES_DB=adctrl SECRET_TOKEN=asdasdasd # Services Directory (where managed services will be stored) -SERVICES_DIR=./services +SERVICES_DIR=/root/services # Scoreboard Configuration SCOREBOARD_WS_URL=ws://10.60.0.1:8080/api/events diff --git a/controler/main.py b/controler/main.py index 5fdeaad..dec2c39 100644 --- a/controler/main.py +++ b/controler/main.py @@ -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",