Xlnk commited on
Commit
d6b36ee
·
verified ·
1 Parent(s): 793f2e9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -82
Dockerfile CHANGED
@@ -1,86 +1,17 @@
1
- FROM ubuntu:22.04
 
2
 
3
- ENV DEBIAN_FRONTEND=noninteractive
4
- ENV TERM=xterm-256color
5
-
6
- # -------------------------
7
- # Base packages
8
- # -------------------------
9
- RUN apt-get update && apt-get install -y \
10
- bash \
11
- curl \
12
- wget \
13
- git \
14
- nano \
15
- vim \
16
- htop \
17
- ca-certificates \
18
- sudo \
19
- gnupg \
20
- lsb-release \
21
- unzip \
22
- && rm -rf /var/lib/apt/lists/*
23
-
24
- # -------------------------
25
- # Python
26
- # -------------------------
27
- RUN apt-get update && apt-get install -y \
28
- python3 \
29
- python3-pip \
30
- python3-venv \
31
- && rm -rf /var/lib/apt/lists/*
32
-
33
- # -------------------------
34
- # Node.js (LTS)
35
- # -------------------------
36
- RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
37
- && apt-get install -y nodejs
38
-
39
- # -------------------------
40
- # Go
41
- # -------------------------
42
- RUN wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz \
43
- && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz \
44
- && rm go1.22.0.linux-amd64.tar.gz
45
-
46
- ENV PATH="/usr/local/go/bin:${PATH}"
47
-
48
- # -------------------------
49
- # Docker CLI (NO daemon)
50
- # -------------------------
51
- RUN curl -fsSL https://get.docker.com | sh \
52
- && rm -rf /var/lib/apt/lists/*
53
-
54
- # -------------------------
55
- # Install ttyd
56
- # -------------------------
57
- RUN wget https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 \
58
- -O /usr/local/bin/ttyd \
59
- && chmod +x /usr/local/bin/ttyd
60
-
61
- # -------------------------
62
- # User (ephemeral session)
63
- # -------------------------
64
- RUN useradd -m terminal \
65
- && echo "terminal ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
66
-
67
- # -------------------------
68
- # Welcome banner
69
- # -------------------------
70
- COPY banner.txt /etc/banner.txt
71
-
72
- RUN echo 'cat /etc/banner.txt' >> /etc/bash.bashrc && \
73
- echo 'cd /tmp' >> /etc/bash.bashrc
74
-
75
- # -------------------------
76
- # Session cleanup on exit
77
- # -------------------------
78
- RUN echo 'rm -rf /tmp/*' >> /etc/bash.bashrc
79
-
80
- USER terminal
81
- WORKDIR /tmp
82
 
 
83
  EXPOSE 7860
84
 
85
- # -W = close session when browser disconnects
86
- CMD ["ttyd", "-p", "7860", "-W", "bash"]
 
 
 
 
 
 
 
1
+ # Use the official linuxserver code-server image
2
+ FROM linuxserver/code-server:latest
3
 
4
+ # Set working directory
5
+ WORKDIR /config # linuxserver uses /config for settings and projects
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
+ # Expose HF Spaces port
8
  EXPOSE 7860
9
 
10
+ # Environment variables
11
+ ENV PUID=1000 # default user id
12
+ ENV PGID=1000 # default group id
13
+ ENV TZ=UTC # timezone
14
+ ENV PASSWORD="" # empty password for no-auth (HF Spaces)
15
+
16
+ # Start code-server binding to HF Spaces port
17
+ CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "/config"]