saadpie commited on
Commit
cc3ff80
·
verified ·
1 Parent(s): bb92c10

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -9
Dockerfile CHANGED
@@ -2,29 +2,29 @@ FROM ubuntu:22.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
- # Minimal deps for ttyd + healthcheck
6
  RUN apt-get update && apt-get install -y \
7
  wget \
8
  curl \
9
  ca-certificates \
10
- libwebsockets15 \
11
  tini \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Download ttyd static binary
15
  RUN ARCH=$(uname -m) && \
16
  if [ "$ARCH" = "x86_64" ]; then DL_ARCH="x86_64"; else DL_ARCH="aarch64"; fi && \
17
- wget -q -O /usr/local/bin/ttyd \
18
- https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.${DL_ARCH} && \
19
- chmod +x /usr/local/bin/ttyd
 
 
20
 
21
- # ⚠️ HF mounts persistent storage at /data — create it explicitly
22
  RUN mkdir -p /data && chmod 777 /data
23
  WORKDIR /data
24
 
25
  # Config
26
  ENV APP_PORT=7860
27
- # Use simple alphanumeric password to avoid shell parsing issues
28
  ENV TERMINAL_PASSWORD="changeme123"
29
 
30
  EXPOSE 7860
@@ -35,7 +35,7 @@ HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=3 \
35
 
36
  ENTRYPOINT ["/usr/bin/tini", "--"]
37
 
38
- # ⚠️ Critical flags: --interface 0.0.0.0 + bind to /data
39
  CMD ["/usr/local/bin/ttyd", \
40
  "--writable", \
41
  "--interface", "0.0.0.0", \
 
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ # Install minimal dependencies (NO libwebsockets needed for static ttyd binary)
6
  RUN apt-get update && apt-get install -y \
7
  wget \
8
  curl \
9
  ca-certificates \
 
10
  tini \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Download ttyd 1.7.7 static binary with architecture detection + error handling
14
  RUN ARCH=$(uname -m) && \
15
  if [ "$ARCH" = "x86_64" ]; then DL_ARCH="x86_64"; else DL_ARCH="aarch64"; fi && \
16
+ wget -q --show-progress -O /usr/local/bin/ttyd \
17
+ "https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.${DL_ARCH}" && \
18
+ chmod +x /usr/local/bin/ttyd && \
19
+ # Verify it's a valid executable
20
+ /usr/local/bin/ttyd --version || exit 1
21
 
22
+ # HF mounts persistent storage at /data — create it explicitly
23
  RUN mkdir -p /data && chmod 777 /data
24
  WORKDIR /data
25
 
26
  # Config
27
  ENV APP_PORT=7860
 
28
  ENV TERMINAL_PASSWORD="changeme123"
29
 
30
  EXPOSE 7860
 
35
 
36
  ENTRYPOINT ["/usr/bin/tini", "--"]
37
 
38
+ # Critical: --interface 0.0.0.0 so HF proxy can route traffic
39
  CMD ["/usr/local/bin/ttyd", \
40
  "--writable", \
41
  "--interface", "0.0.0.0", \