diff --git a/Dockerfile b/Dockerfile index 95c565c..d10e550 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,27 @@ FROM python:3.12-slim +RUN apt update && apt upgrade -y && apt install git -y WORKDIR /app # Copy the entire project -COPY . . +# TODO: do not copy the whole project; make auracast-translator-client(only) available as a package +COPY . ./webui -# Install the package and dependencies -RUN --mount=type=cache,target=/root/.cache pip install --no-cache-dir . +# 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 +RUN poetry config virtualenvs.create false + +# Install the dependencies +WORKDIR /app/webui +RUN poetry install --no-interaction --no-ansi +WORKDIR /app # Expose Streamlit port EXPOSE 8501 @@ -14,5 +29,6 @@ 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 bb69ba3..73d655b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.8' - services: webui: build: @@ -14,9 +12,9 @@ services: # Change this URL if the translator service is running on a different host - TRANSLATOR_API_URL=http://translator:7999 restart: unless-stopped - networks: - - webui-network - - translator-network + # networks: + # - webui-network + # - translator-network # Uncomment the below if you want the webui to depend on the translator # when running the two services together # depends_on: diff --git a/pyproject.toml b/pyproject.toml index 96f0ad4..d378447 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ auracast-translator = {path = "../auracast-translator"} pytest=">7.0.0" [tool.poetry.scripts] -auracaster-webui = "auracaster_webui.main:run_app" +auracaster-webui = "auracaster_webui.main_ui:run_app" auracaster-mock = "mock_backend.main:run_mock" [build-system]