diff --git a/Dockerfile b/Dockerfile index bba3299..4a692c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,18 @@ FROM python:3.11 WORKDIR /app -RUN apt update -y && apt install docker-compose -y +# Install dependencies and Docker's official GPG key +RUN apt-get update && \ + apt-get install -y ca-certificates curl && \ + install -m 0755 -d /etc/apt/keyrings && \ + curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && \ + chmod a+r /etc/apt/keyrings/docker.asc + +# Add Docker's official repository to Apt sources +RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo $VERSION_CODENAME) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \ + apt-get update + +RUN apt-get update -y && apt-get install docker-compose-plugin docker-ce-cli -y COPY requirements.txt ./ diff --git a/server/utils.py b/server/utils.py index 5f79b96..6a18fd2 100644 --- a/server/utils.py +++ b/server/utils.py @@ -94,7 +94,7 @@ def start_services( logger.error(f"Error generating processed compose file: {e}") raise HTTPException(500, e) - command = ["docker-compose", "up", "-d", "--build"] + command = ["docker", "compose", "up", "-d", "--build"] project_dir = pathlib.Path(self._compose_file_location).parent try: @@ -109,7 +109,7 @@ def remove_services(self): if not os.path.exists(pathlib.Path(self._compose_file_location).parent): logger.info(f"{self._compose_file_location} is already deleted!") return "Deployment already deleted" - command = ["docker-compose", "down", "-v"] + command = ["docker", "compose", "down", "-v"] project_dir = pathlib.Path(self._compose_file_location).parent try: subprocess.run(command, check=True, cwd=project_dir)