saadpie commited on
Commit
beaef72
·
verified ·
1 Parent(s): d70714b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -39
Dockerfile CHANGED
@@ -1,47 +1,11 @@
1
  FROM ubuntu:22.04
2
-
3
  ENV DEBIAN_FRONTEND=noninteractive
4
-
5
- # Stage 1: Install core tools only (fast)
6
- RUN apt-get update && apt-get install -y --no-install-recommends \
7
- # Core utilities
8
- wget curl git ca-certificates tini \
9
- # Python (system version is fine for most use cases)
10
- python3 python3-pip python3-venv \
11
- # Node.js (minimal)
12
- nodejs npm \
13
- # Build tools (only if needed for pip/node packages)
14
- build-essential \
15
- # Useful CLI tools
16
- jq zip unzip nano \
17
- && rm -rf /var/lib/apt/lists/*
18
-
19
- # Stage 2: Download ttyd
20
- RUN ARCH=$(uname -m) && \
21
- if [ "$ARCH" = "x86_64" ]; then DL_ARCH="x86_64"; else DL_ARCH="aarch64"; fi && \
22
- wget -q -O /usr/local/bin/ttyd \
23
- "https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.${DL_ARCH}" && \
24
- chmod +x /usr/local/bin/ttyd
25
-
26
- # Stage 3: Install uv (fast Python package manager) + common packages
27
- RUN curl -LsSf https://astral.sh/uv/install.sh | sh
28
- ENV PATH="/root/.local/bin:$PATH"
29
- RUN uv python install 3.11 && \
30
- uv python pin 3.11 && \
31
- uv pip install pip setuptools wheel requests httpx rich typer
32
-
33
- # Stage 4: Setup persistent storage
34
  RUN mkdir -p /data && chmod 777 /data
35
  WORKDIR /data
36
-
37
- # Environment
38
  ENV TERMINAL_PASSWORD="changeme123"
39
  EXPOSE 7860
40
-
41
- # Health check
42
- HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=3 \
43
- CMD curl -sf -u admin:changeme123 http://localhost:7860/ || exit 1
44
-
45
- # Start
46
  ENTRYPOINT ["/usr/bin/tini", "--"]
47
  CMD ["/usr/local/bin/ttyd", "--writable", "--interface", "0.0.0.0", "--port", "7860", "--credential", "admin:changeme123", "bash", "-l"]
 
1
  FROM ubuntu:22.04
 
2
  ENV DEBIAN_FRONTEND=noninteractive
3
+ RUN apt-get update && apt-get install -y --no-install-recommends wget curl git ca-certificates tini python3 python3-pip python3-venv && rm -rf /var/lib/apt/lists/*
4
+ RUN ARCH=$(uname -m) && if [ "$ARCH" = "x86_64" ]; then DA="x86_64"; else DA="aarch64"; fi && wget -q -O /usr/local/bin/ttyd "https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.${DA}" && chmod +x /usr/local/bin/ttyd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  RUN mkdir -p /data && chmod 777 /data
6
  WORKDIR /data
 
 
7
  ENV TERMINAL_PASSWORD="changeme123"
8
  EXPOSE 7860
9
+ HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=3 CMD curl -sf -u admin:changeme123 http://localhost:7860/ || exit 1
 
 
 
 
 
10
  ENTRYPOINT ["/usr/bin/tini", "--"]
11
  CMD ["/usr/local/bin/ttyd", "--writable", "--interface", "0.0.0.0", "--port", "7860", "--credential", "admin:changeme123", "bash", "-l"]