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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -16,14 +16,14 @@ RUN apt-get update && apt-get install -y \
16
  # Install code-server
17
  RUN curl -fsSL https://code-server.dev/install.sh | sh
18
 
19
- # Create workspace directory
20
- RUN mkdir -p /workspace
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 && \
@@ -33,8 +33,8 @@ RUN echo "# Welcome to your Hugging Face Space Code Server!" >> README.md && \
33
  echo "- Use the integrated terminal" >> README.md && \
34
  echo "- Clone repositories" >> README.md
35
 
36
- # Expose port 7860 (required for HF Spaces)
37
  EXPOSE 7860
38
 
39
- # Run code-server
40
- CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "--disable-telemetry", "/workspace"]
 
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 && \
 
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"]