AkshitShubham commited on
Commit
1d47c27
·
verified ·
1 Parent(s): f1e7dfb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -27
Dockerfile CHANGED
@@ -1,40 +1,28 @@
1
  FROM ubuntu:22.04
2
-
3
- # Set environment variables
4
  ENV DEBIAN_FRONTEND=noninteractive
5
 
6
- # Install dependencies
7
  RUN apt-get update && apt-get install -y \
8
- curl \
9
- wget \
10
- git \
11
- build-essential \
12
- nodejs \
13
- npm \
14
- && rm -rf /var/lib/apt/lists/*
15
 
16
- # Install code-server
17
  RUN curl -fsSL https://code-server.dev/install.sh | sh
18
 
19
- # Create workspace and config directories
20
- RUN mkdir -p /workspace /root/.config /root/.local/share /root/.cache
 
 
 
21
 
22
- # Set working directory
23
  WORKDIR /workspace
24
 
25
- # Create a welcome file
26
- RUN echo "# Welcome to your Hugging Face Space Code Server!" > README.md && \
27
- echo "" >> README.md && \
28
- echo "This is VS Code running in your browser on Hugging Face Spaces." >> README.md && \
29
- echo "" >> README.md && \
30
- echo "You can:" >> README.md && \
31
- echo "- Edit files directly in the browser" >> README.md && \
32
- echo "- Install extensions" >> README.md && \
33
- echo "- Use the integrated terminal" >> README.md && \
34
- echo "- Clone repositories" >> README.md
35
 
36
- # Expose port 7860
37
  EXPOSE 7860
38
 
39
- # Run code-server with a custom config directory
40
- CMD ["code-server", "--user-data-dir", "/root/.config/code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "--disable-telemetry", "/workspace"]
 
 
 
 
 
1
  FROM ubuntu:22.04
 
 
2
  ENV DEBIAN_FRONTEND=noninteractive
3
 
 
4
  RUN apt-get update && apt-get install -y \
5
+ curl wget git build-essential nodejs npm \
6
+ && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
7
 
 
8
  RUN curl -fsSL https://code-server.dev/install.sh | sh
9
 
10
+ # Pre-create and chown config/cache dirs for code-server
11
+ RUN mkdir -p /root/.config/code-server \
12
+ /root/.local/share/code-server \
13
+ /root/.cache/code-server \
14
+ && chown -R 1000:1000 /root/.config /root/.local /root/.cache
15
 
16
+ RUN mkdir -p /workspace
17
  WORKDIR /workspace
18
 
19
+ # (Optional) Create README, etc.
 
 
 
 
 
 
 
 
 
20
 
 
21
  EXPOSE 7860
22
 
23
+ CMD ["code-server", \
24
+ "--user-data-dir", "/root/.config/code-server", \
25
+ "--bind-addr", "0.0.0.0:7860", \
26
+ "--auth", "none", \
27
+ "--disable-telemetry", \
28
+ "/workspace"]