From 03585726b54db705ab63380a9790fbc6f3cb2303 Mon Sep 17 00:00:00 2001 From: pstruebi Date: Sun, 23 Mar 2025 16:36:30 +0100 Subject: [PATCH] update docker build --- Dockerfile | 22 +++++++++++----------- docker-compose.yml | 2 ++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index d10e550..50219a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,24 @@ FROM python:3.12-slim -RUN apt update && apt upgrade -y && apt install git -y - -WORKDIR /app - -# Copy the entire project -# TODO: do not copy the whole project; make auracast-translator-client(only) available as a package -COPY . ./webui +RUN apt update && apt upgrade -y && apt install git -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* # accept new ssh server RUN sed /^StrictHostKeyChecking/d /etc/ssh/ssh_config; \ echo StrictHostKeyChecking no >> /etc/ssh/ssh_config -RUN --mount=type=ssh,required=true \ - git clone --single-branch --branch server_deployment ssh://git@ssh.pstruebi.xyz:222/auracaster/auracast-translator.git RUN --mount=type=cache,target=/root/.cache \ - pip install poetry +pip install poetry RUN poetry config virtualenvs.create false +WORKDIR /app +# TODO: do not checkout the whole project; make auracast-translator-client(only) available as a package +RUN --mount=type=ssh,required=true \ +git clone --single-branch --branch server_deployment ssh://git@ssh.pstruebi.xyz:222/auracaster/auracast-translator.git + +# copy the app code +COPY . ./webui # Install the dependencies WORKDIR /app/webui RUN poetry install --no-interaction --no-ansi @@ -29,6 +30,5 @@ EXPOSE 8501 # Set environment variables ENV PYTHONUNBUFFERED=1 - # Run the Streamlit app CMD ["auracaster-webui"] diff --git a/docker-compose.yml b/docker-compose.yml index 73d655b..32cc755 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,8 @@ services: build: context: . dockerfile: Dockerfile + ssh: + - default=~/.ssh/id_ed25519 #lappi ports: - "8501:8501" volumes: