Spaces:
Running
Running
FROM python:3.12 | |
ARG CACHEBUSTER=3 | |
RUN echo "Cache busting: ${CACHEBUSTER}" | |
# Install git | |
RUN apt-get update && apt-get install -y git | |
# Copy uv from astral-sh image | |
COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv | |
# Set up a new user named "user" | |
RUN useradd -m -u 1000 user | |
ENV PATH="/home/user/.local/bin:$PATH" | |
ENV UV_SYSTEM_PYTHON=1 | |
# Create work directory | |
WORKDIR /app | |
# Clone the private repo using the GitHub token | |
# We'll use build arguments and ARGs to pass the token | |
ARG REPO_URL="github.com/Jhsmit/instagibbs.git" | |
ARG CACHEBUSTER | |
# The secret 'github_token' must be provided during the build | |
RUN --mount=type=secret,id=GITHUB_TOKEN \ | |
git clone https://$(cat /run/secrets/GITHUB_TOKEN)@${REPO_URL} instagibbs | |
# clone the datasets repo | |
RUN git clone https://github.com/Jhsmit/HDX-MS-datasets | |
# Install requirements | |
WORKDIR /app/instagibbs | |
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache | |
RUN git pull | |
RUN uv pip install -e . | |
# Switch to non-root user | |
USER user | |
# Run the app | |
CMD ["solara", "run", "instagibbs/web/app.py", "--host", "0.0.0.0", "--port", "7860"] | |