File size: 1,661 Bytes
c3f412e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM python:3.11-slim

# -----------------------
# System deps
# -----------------------
WORKDIR /app

RUN apt-get update && apt-get install -y \
    curl \
    gnupg \
    git \
    libgl1 \
    libglib2.0-0 \
    && curl -sL https://deb.nodesource.com/setup_20.x | bash - \
    && apt-get install -y nodejs \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# -----------------------
# Install gh CLI
# -----------------------
RUN mkdir -p -m 755 /etc/apt/keyrings \
 && curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/etc/apt/keyrings/githubcli-archive-keyring.gpg \
 && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
 && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
 && apt-get update \
 && apt-get install -y gh \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

# -----------------------
# Git stability fixes (CRITICAL)
# -----------------------
RUN git config --global http.version HTTP/1.1 \
 && git config --global core.compression 0

# -----------------------
# Create HF user
# -----------------------
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# -----------------------
# App code
# -----------------------
WORKDIR /home/user/app
COPY --chown=user . .

# -----------------------
# Frontend build
# -----------------------
WORKDIR /home/user/app
RUN chmod +x ./start.sh

WORKDIR /home/user/app

# -----------------------
# Runtime
# -----------------------
EXPOSE 7860

CMD ["./start.sh"]