From 8695e92f5d14ed3798cea49cacb967abc3585537 Mon Sep 17 00:00:00 2001 From: Mohamed ASSOUKTI Date: Mon, 7 Oct 2024 11:05:13 +0200 Subject: [PATCH 1/2] [Fix] Prevent Poetry compilation problems in non-Linux environments --- gen-ai-orchestrator-server/Dockerfile | 27 +++++++++++++++++++++++---- gen-ai-orchestrator-server/pom.xml | 1 + 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/gen-ai-orchestrator-server/Dockerfile b/gen-ai-orchestrator-server/Dockerfile index 4f32e6c..0f9d8b4 100644 --- a/gen-ai-orchestrator-server/Dockerfile +++ b/gen-ai-orchestrator-server/Dockerfile @@ -1,13 +1,32 @@ FROM python:3.11-alpine +# Set environment variables +ENV PYTHONUNBUFFERED=1 \ + POETRY_VERSION=1.8.3 \ + # Poetry virtual environments are disabled to install packages globally inside the container. + POETRY_VIRTUALENVS_CREATE=false \ + POETRY_NO_INTERACTION=1 \ + # The Poetry cache directory is set to reduce repeated downloads in future builds. + POETRY_CACHE_DIR='/var/cache/pypoetry' + +# Install Poetry +RUN pip install "poetry==$POETRY_VERSION" + +# Set working directory in the container WORKDIR /app -COPY target/requirements.txt . +# Copy only the necessary files to the Docker container +COPY target/server/pyproject.toml /app/ +COPY target/server/poetry.lock /app/ -RUN pip install --no-cache-dir -r requirements.txt +# Install dependencies +RUN poetry install --no-root --no-dev --verbose -COPY target/gen_ai_orchestrator gen_ai_orchestrator/ +# Copy the rest of the project files into the container +COPY target/server/src/gen_ai_orchestrator gen_ai_orchestrator/ +# Expose port for web app EXPOSE 8000 -CMD ["uvicorn", "gen_ai_orchestrator.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-config", "gen_ai_orchestrator/configurations/logging/config.ini"] \ No newline at end of file +# Run the application +CMD ["uvicorn", "gen_ai_orchestrator.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-config", "gen_ai_orchestrator/configurations/logging/config.ini"] diff --git a/gen-ai-orchestrator-server/pom.xml b/gen-ai-orchestrator-server/pom.xml index 9183c31..750e648 100644 --- a/gen-ai-orchestrator-server/pom.xml +++ b/gen-ai-orchestrator-server/pom.xml @@ -50,6 +50,7 @@ io.fabric8 docker-maven-plugin + true tock/gen-ai-orchestrator-server:${project.version} From 237718ddaf605fb60d436b64a107f7aaeda428b8 Mon Sep 17 00:00:00 2001 From: Mohamed ASSOUKTI Date: Mon, 7 Oct 2024 16:10:34 +0200 Subject: [PATCH 2/2] [Fix] review --- gen-ai-orchestrator-server/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/gen-ai-orchestrator-server/pom.xml b/gen-ai-orchestrator-server/pom.xml index 750e648..9183c31 100644 --- a/gen-ai-orchestrator-server/pom.xml +++ b/gen-ai-orchestrator-server/pom.xml @@ -50,7 +50,6 @@ io.fabric8 docker-maven-plugin - true tock/gen-ai-orchestrator-server:${project.version}