File size: 887 Bytes
56f4d28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM python:3.10-slim AS env-builder

# Install system build tools
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git gh \
    vim \
    && rm -rf /var/lib/apt/lists/*

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Clone paladin repo
WORKDIR /deps
RUN --mount=type=secret,id=github_token \
    export GITHUB_TOKEN=$(cat /run/secrets/github_token) && \
    git clone --branch dev https://oauth2:$GITHUB_TOKEN@github.com/pathology-data-mining/paladin.git

# Create non-root user for runtime
RUN useradd -m -u 1000 user
RUN chown -R user:user /deps

WORKDIR /app
RUN chown -R user:user /app

USER user
COPY --chown=user pyproject.toml README.md ./
COPY --chown=user src/ ./src/

RUN uv sync 
ENV PATH="/app/.venv/bin:$PATH"

EXPOSE 7877

# HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["gradio_app"]