File size: 1,122 Bytes
740919f
 
aaaae84
cf64bb3
 
 
740919f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aaaae84
13b901d
 
 
aaaae84
8cc7cec
 
 
740919f
 
5578061
 
 
 
740919f
 
 
 
 
 
 
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
40
41
42
43
44
45
46
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"]