NitinBot002 commited on
Commit
e6d42f7
·
verified ·
1 Parent(s): 5a9a1d5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -38
Dockerfile CHANGED
@@ -1,43 +1,21 @@
1
- # Dockerfile
2
- FROM python:3.9-slim
3
 
4
- # Install system dependencies
5
- RUN apt-get update && apt-get install -y \
6
- curl \
7
- wget \
8
- git \
9
- build-essential \
10
- nodejs \
11
- npm \
12
- && rm -rf /var/lib/apt/lists/*
13
 
14
- # Install code-server
15
- # RUN curl -fsSL https://code-server.dev/install.sh | sh
16
- RUN apt-get install code-server
17
- # Verify code-server installation
18
- RUN code-server --version
19
 
20
- # Set working directory
21
- WORKDIR /app
22
 
23
- # Copy requirements and install Python packages
24
- COPY requirements.txt .
25
- RUN pip install --no-cache-dir -r requirements.txt
26
 
27
- # Copy application files
28
- COPY . .
29
-
30
- # Create workspace directory and set permissions
31
- RUN mkdir -p /tmp/workspace && \
32
- mkdir -p /root/.config/code-server && \
33
- chmod -R 755 /tmp/workspace
34
-
35
- # Expose ports
36
- EXPOSE 7860 8080
37
-
38
- # Set environment variables
39
- ENV PORT=7860
40
- ENV CODE_SERVER_PASSWORD=huggingface123
41
-
42
- # Run the application
43
- CMD ["python", "app.py"]
 
1
+ FROM python:3.10-slim
 
2
 
3
+ # Coder server needs Docker CLI to launch workspaces
4
+ RUN apt-get update \
5
+ && apt-get install -y curl docker.io ca-certificates \
6
+ && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
7
 
8
+ # Add a non-root user matching Coder docs
9
+ RUN useradd -m -u 1000 coder
10
+ USER coder
11
+ ENV HOME=/home/coder PATH=/home/coder/.local/bin:$PATH
12
+ WORKDIR /home/coder
13
 
14
+ # Install Coder CLI
15
+ RUN curl -fsSL https://coder.com/install.sh | sh
16
 
17
+ # Expose Coder server default port
18
+ EXPOSE 3000
 
19
 
20
+ # Launch the Coder server
21
+ CMD ["coder", "server", "--host", "0.0.0.0", "--port", "7860"]