File size: 3,194 Bytes
af31654
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a74b29d
af31654
 
a74b29d
 
 
 
 
 
 
 
 
 
af31654
 
 
 
 
 
 
 
 
 
 
 
 
 
59ecdf1
af31654
 
 
 
 
 
 
 
 
 
 
 
 
 
a74b29d
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
# ── Base image ────────────────────────────────────────────────────────────────
FROM node:20-slim

# ── System dependencies ───────────────────────────────────────────────────────
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        python3 \
        python3-pip \
        python3-venv \
        make \
        g++ \
        wget \
        curl \
        git \
        neofetch \
        mediainfo \
        screen \
        nano \
        openssh-server \
    && rm -rf /var/lib/apt/lists/*

# ── Install bore (TCP tunnel β€” exposes SSH publicly for Termius) ──────────────
RUN wget -q "https://github.com/ekzhang/bore/releases/download/v0.5.0/bore-v0.5.0-x86_64-unknown-linux-musl.tar.gz" \
        -O /tmp/bore.tar.gz && \
    tar -xzf /tmp/bore.tar.gz -C /usr/local/bin bore && \
    chmod +x /usr/local/bin/bore && \
    rm /tmp/bore.tar.gz

# ── Prepare SSH runtime dirs ──────────────────────────────────────────────────
RUN mkdir -p /run/sshd /root/.ssh

# ── Pin a stable machine-id ───────────────────────────────────────────────────
RUN echo "d8904b4d338adf83688caac869f64c0b" > /etc/machine-id && \
    mkdir -p /var/lib/dbus && \
    echo "d8904b4d338adf83688caac869f64c0b" > /var/lib/dbus/machine-id

# ── Set HOME for root ─────────────────────────────────────────────────────────
ENV HOME=/root \
    PATH="/root/.npm-global/bin:/root/venv/bin:${PATH}" \
    VIRTUAL_ENV=/root/venv \
    PIP_NO_CACHE_DIR=1

# ── Create a persistent Python venv ──────────────────────────────────────────
RUN python3 -m venv /root/venv && \
    /root/venv/bin/pip install --upgrade pip && \
    /root/venv/bin/pip install huggingface_hub

# ── Install shellular globally ────────────────────────────────────────────────
RUN npm config set prefix /root/.npm-global && \
    npm install -g shellular

# ── App ───────────────────────────────────────────────────────────────────────
WORKDIR /root/app
COPY package*.json ./
RUN npm install --omit=dev
COPY . .

# ── Runtime ───────────────────────────────────────────────────────────────────
EXPOSE 7860
ENV PORT=7860
CMD ["node", "app.js"]