# Build from the project root: docker build -f s2s-client/Dockerfile -t s2s-client .
# Serve backend APIs, the WebSocket proxy, and shared project documentation.
# Run the React/Vite frontend separately; this image contains no browser UI.
# HF Spaces (sdk: docker) routes traffic to $PORT, default 7860.
FROM python:3.12.14-slim

COPY --from=ghcr.io/astral-sh/uv:0.12.5 /uv /uvx /bin/

ENV UV_LINK_MODE=copy \
    UV_PYTHON_DOWNLOADS=never \
    PATH="/app/s2s-client/.venv/bin:$PATH"

WORKDIR /app/s2s-client

COPY s2s-client/pyproject.toml s2s-client/uv.lock ./
RUN uv sync --locked --no-dev --no-install-project

COPY s2s-client/README.md s2s-client/server.py ./
COPY s2s-client/s2s_client/ ./s2s_client/
COPY docs/ /app/docs/
RUN uv sync --locked --no-dev

EXPOSE 7860

CMD ["uvicorn", "s2s_client.main:app", "--host", "0.0.0.0", "--port", "7860"]
