likhonsheikhdev commited on
Commit
99e5ccb
·
verified ·
1 Parent(s): 97a64e7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -17
Dockerfile CHANGED
@@ -1,29 +1,40 @@
1
- # Base image with Python and Node.js (needed for code-server + AI agent tools)
2
- FROM python:3.11-slim
3
 
4
- # Install basic dependencies
 
 
5
  RUN apt-get update && apt-get install -y \
6
- curl wget git build-essential \
7
- nodejs npm gnupg \
 
 
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Install code-server
11
  RUN curl -fsSL https://code-server.dev/install.sh | sh
12
 
13
- # Setup working dir
14
- WORKDIR /workspace
 
 
 
 
 
 
 
 
15
 
16
- # Copy files
17
- COPY . /workspace
18
 
19
- # Install Python dependencies
20
- RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # Make entrypoint executable
23
- RUN chmod +x /workspace/entrypoint.sh
24
 
25
- # Expose code-server default port
26
  EXPOSE 7860
27
 
28
- # Run entrypoint (starts code-server + agent logic)
29
- ENTRYPOINT ["/workspace/entrypoint.sh"]
 
1
+ FROM ubuntu:22.04
 
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ # --- 1. Base dependencies ---
6
  RUN apt-get update && apt-get install -y \
7
+ curl wget git sudo build-essential gnupg lsb-release \
8
+ ca-certificates software-properties-common \
9
+ python3 python3-pip python3-venv \
10
+ nodejs npm \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # --- 2. Add code-server ---
14
  RUN curl -fsSL https://code-server.dev/install.sh | sh
15
 
16
+ # Create a new user for code-server
17
+ RUN useradd -m coder \
18
+ && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
19
+
20
+ # Set working dir
21
+ WORKDIR /home/coder
22
+
23
+ # Add code-server config (no auth for simplicity)
24
+ RUN mkdir -p /home/coder/.config/code-server
25
+ COPY --chown=coder:coder config.yaml /home/coder/.config/code-server/config.yaml
26
 
27
+ # Copy optional agent code
28
+ COPY . /home/coder/project
29
 
30
+ # Change ownership
31
+ RUN chown -R coder:coder /home/coder
32
 
33
+ # Switch to user
34
+ USER coder
35
 
36
+ # Expose the code-server port
37
  EXPOSE 7860
38
 
39
+ # Start code-server
40
+ CMD ["code-server"]