From a20ec2885e28b04f92675a22f01951814ee688b5 Mon Sep 17 00:00:00 2001 From: Adam Ladachowski Date: Sat, 14 Feb 2026 08:54:39 +0100 Subject: [PATCH] Add custom Dockerfile for Tengu build --- .dockerignore | 15 +++++++++++++++ Dockerfile | 29 +++++++++++++++++++++++++++++ app.yml | 3 +-- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2c02233 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +.git +.venv +.pytest_cache +.mypy_cache +.ruff_cache +__pycache__ +*.pyc +*.pyo +*.egg-info +dist +build +.coverage +htmlcov +screenshots +tensors/server/ui/node_modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fa9e6a0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Build stage +FROM saiden/tengu:python-3.12-dev AS builder + +WORKDIR /app + +# Copy everything needed for the package +COPY . . + +# Install dependencies and package +RUN uv pip install --system -e '.[server]' + +# Runtime stage +FROM saiden/tengu:python-3.12 + +WORKDIR /app + +# Copy installed packages from builder +COPY --from=builder /usr/local/lib/python3.12 /usr/local/lib/python3.12 +COPY --from=builder /usr/local/bin /usr/local/bin + +# Copy app source +COPY --from=builder /app /app + +# Set environment +ENV PATH="/usr/local/bin:$PATH" + +EXPOSE 5000 + +CMD ["tsr", "serve", "--host", "0.0.0.0", "--port", "5000", "--sd-server", "http://172.17.0.1:1234"] diff --git a/app.yml b/app.yml index b6086ca..bd3755b 100644 --- a/app.yml +++ b/app.yml @@ -1,4 +1,3 @@ runtime: python -build_cmd: uv pip install --system -r requirements.txt && uv pip install --system -e '.[server]' -cmd: tsr serve --host 0.0.0.0 --port 5000 --sd-server http://172.17.0.1:1234 +dockerfile: Dockerfile port: 5000