Pepguy commited on
Commit
f89fbfc
·
verified ·
1 Parent(s): 73ad1fd

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ # Prevent interactive prompts during apt installations
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+ ENV HOME=/home/user
6
+
7
+ # 1. Install base utilities and development tools (Node, Python)
8
+ RUN apt-get update && apt-get install -y \
9
+ curl wget git jq unzip build-essential \
10
+ python3 python3-pip \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # 2. Install VS Code Server (code-server)
14
+ RUN curl -fsSL https://code-server.dev/install.sh | sh
15
+
16
+ # 3. Setup Hugging Face user (UID 1000)
17
+ RUN useradd -m -u 1000 user
18
+ USER user
19
+
20
+ # Set up paths for Rust, Bun, and Node
21
+ ENV PATH="/home/user/.local/bin:/home/user/.cargo/bin:/home/user/.bun/bin:$PATH"
22
+ WORKDIR $HOME
23
+
24
+ # 4. Install Rust
25
+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
26
+
27
+ # 5. Install Bun (unzip is now installed, so this succeeds)
28
+ RUN curl -fsSL https://bun.sh/install | bash
29
+
30
+ # Expose port 7860
31
+ EXPOSE 7860
32
+
33
+ # 6. Start VS Code Server on Hugging Face's port
34
+ # NOTE: "--auth none" is safe ONLY if your Space is PRIVATE.
35
+ # If you make your Space public, change "--auth none" to "--auth password"
36
+ # and set the env variable "ENV PASSWORD=your_secure_password"
37
+ CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "--disable-telemetry"]