Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,25 @@ RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
&& node --version \
&& rm -rf /var/lib/apt/lists/*

RUN pip install gradio
# Run as a non-root user. Python packages go into a virtualenv owned by that
# user (/opt/venv, first on PATH), so the entrypoint's `pip install` calls and
# any `pip install` in a tenant setup.sh keep working without root.
RUN useradd --create-home --uid 1000 --shell /bin/bash runner \
&& python -m venv /opt/venv \
&& mkdir -p /usercontent \
&& chown -R runner:runner /opt/venv /usercontent
ENV VIRTUAL_ENV=/opt/venv
ENV PATH=/opt/venv/bin:$PATH
RUN pip install --no-cache-dir gradio && chown -R runner:runner /opt/venv

# Version of @osaas/cli that docker-entrypoint.sh runs via npx. This is the
# single place the version is pinned; bump it here.
ENV OSAAS_CLI_VERSION=4.35.0
WORKDIR /runner
COPY ./scripts ./
RUN chmod +x ./*.sh
USER runner
ENV HOME=/home/runner
VOLUME /usercontent
ENV PORT=8080
ENTRYPOINT [ "/runner/docker-entrypoint.sh" ]
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ The runner automatically detects and installs dependencies from:

If a `setup.sh` script is present in the repository root, it will be executed after dependency installation.

The container runs as the non-root user `runner` (uid 1000). Python packages are installed into a virtualenv at `/opt/venv` owned by that user, and `/usercontent` is writable by it. `setup.sh` therefore cannot run `apt-get` or other root-only commands.

## Automatic Framework Detection

The runner automatically detects your application type and starts it with the appropriate server:
Expand Down