packaging with docker

This commit is contained in:
2025-03-20 12:08:08 +00:00
parent 6162cae6fd
commit 61a9a64fa5
3 changed files with 23 additions and 9 deletions
+19 -3
View File
@@ -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"]