veltrixcode commited on
Commit
fd1847a
·
verified ·
1 Parent(s): 2ed8330

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -17
Dockerfile CHANGED
@@ -1,46 +1,31 @@
1
- # Use a small base image with Node + common tools
2
  FROM ubuntu:22.04
3
 
4
- # Avoid interactive prompts
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
- # Install dependencies
8
  RUN apt-get update && apt-get install -y \
9
  curl ca-certificates git python3 python3-pip \
10
  build-essential wget sudo \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Install code-server (official script)
14
  RUN curl -fsSL https://code-server.dev/install.sh | sh
15
 
16
- # Create a non-root user (optional but recommended)
17
  RUN useradd -m -s /bin/bash coder && \
18
  echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
19
 
20
  USER coder
21
  WORKDIR /home/coder
22
 
23
- # Directory where your projects will live
24
- # This will be symlinked to /data to get persistence
25
  RUN mkdir -p /home/coder/projects
26
 
27
- # Hugging Face Spaces mount /data when you enable persistent storage
28
- # Use /data as your persistent directory
29
  USER root
30
  RUN mkdir -p /data && chown -R coder:coder /data
31
  USER coder
32
 
33
- # Optional: symlink a folder into /data so your work persists
34
  RUN ln -s /data /home/coder/persist
35
 
36
- # Expose the port code-server will listen on
37
  EXPOSE 7860
38
 
39
- # Environment variables
40
- # PASSWORD: set some password so you can log in from your PC
41
- # BIND-ADDR: bind to all interfaces at port 7860
42
- ENV PASSWORD="changeme"
43
  ENV PORT=7860
44
 
45
- # Start code-server with the project root pointing to /data
46
- CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "/data"]
 
 
1
  FROM ubuntu:22.04
2
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  curl ca-certificates git python3 python3-pip \
7
  build-essential wget sudo \
8
  && rm -rf /var/lib/apt/lists/*
9
 
 
10
  RUN curl -fsSL https://code-server.dev/install.sh | sh
11
 
 
12
  RUN useradd -m -s /bin/bash coder && \
13
  echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
14
 
15
  USER coder
16
  WORKDIR /home/coder
17
 
 
 
18
  RUN mkdir -p /home/coder/projects
19
 
 
 
20
  USER root
21
  RUN mkdir -p /data && chown -R coder:coder /data
22
  USER coder
23
 
 
24
  RUN ln -s /data /home/coder/persist
25
 
 
26
  EXPOSE 7860
27
 
 
 
 
 
28
  ENV PORT=7860
29
 
30
+ # No PASSWORD env; explicitly disable auth
31
+ CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "/data"]