File size: 1,343 Bytes
e66e94d
 
 
 
2e658e7
e66e94d
2e658e7
 
 
e66e94d
 
 
 
 
 
 
2e658e7
e66e94d
 
2e658e7
e66e94d
2e658e7
e66e94d
 
 
2e658e7
e66e94d
 
 
 
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
# Deploy this into an EXISTING Docker-SDK Space you already own
# (e.g. SimpleChatbot, ultichat, Datasourceforcryptocurrency-4) — creating a
# brand-new free Docker Space currently requires a paid HF plan, but Spaces
# you already have are grandfathered onto the free tier.

FROM diegosouzapw/omniroute:latest

USER root

# Install python3 + huggingface_hub for the state-sync script. Base image
# distro isn't guaranteed — try Debian/Ubuntu's apt first, fall back to
# Alpine's apk. If BOTH fail, check what `cat /etc/os-release` reports in
# the image and adjust this line accordingly.
RUN (apt-get update && apt-get install -y --no-install-recommends python3 python3-pip && rm -rf /var/lib/apt/lists/*) \
    || (apk add --no-cache python3 py3-pip)
RUN pip3 install --no-cache-dir --break-system-packages huggingface_hub

COPY sync-entrypoint.sh /app/sync-entrypoint.sh
RUN chmod +x /app/sync-entrypoint.sh && chown -R node:node /app/sync-entrypoint.sh /app/data 2>/dev/null || true

USER node

# HF Spaces only route traffic to port 7860, regardless of SDK.
ENV PORT=7860
EXPOSE 7860

# The base image's ENTRYPOINT is /app/check-permissions.sh, which execs
# whatever CMD is given to it — so this CMD override still goes through
# the image's own permission setup, it just replaces the final command.
CMD ["/app/sync-entrypoint.sh"]