shashwatIDR commited on
Commit
24c7dbc
·
verified ·
1 Parent(s): 8e31a92

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -6
Dockerfile CHANGED
@@ -1,16 +1,22 @@
1
  FROM codercom/code-server:latest
2
 
3
- # Switch to root user
4
  USER root
5
 
6
  # Install Python and Node.js
7
  RUN apt-get update && \
8
  apt-get install -y python3 python3-pip curl && \
9
  curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
10
- apt-get install -y nodejs
 
 
11
 
12
- # Create the working directory as root
13
- RUN mkdir -p /animesh
 
 
 
 
14
 
15
  # Set the working directory
16
  WORKDIR /animesh
@@ -18,5 +24,5 @@ WORKDIR /animesh
18
  # Expose port for Hugging Face Spaces
19
  EXPOSE 7860
20
 
21
- # Run code-server as root without authentication
22
- CMD ["code-server", "--auth=none", "--bind-addr", "0.0.0.0:7860", "/animesh"]
 
1
  FROM codercom/code-server:latest
2
 
3
+ # Switch to root user temporarily for installations
4
  USER root
5
 
6
  # Install Python and Node.js
7
  RUN apt-get update && \
8
  apt-get install -y python3 python3-pip curl && \
9
  curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
10
+ apt-get install -y nodejs && \
11
+ apt-get clean && \
12
+ rm -rf /var/lib/apt/lists/*
13
 
14
+ # Create the working directory and set proper ownership
15
+ RUN mkdir -p /animesh && \
16
+ chown -R coder:coder /animesh
17
+
18
+ # Switch back to the coder user (this is important for fixuid to work properly)
19
+ USER coder
20
 
21
  # Set the working directory
22
  WORKDIR /animesh
 
24
  # Expose port for Hugging Face Spaces
25
  EXPOSE 7860
26
 
27
+ # Run code-server with proper configuration
28
+ CMD ["code-server", "--auth=none", "--bind-addr", "0.0.0.0:7860", "/animesh"]