File size: 970 Bytes
99e5ccb
97a64e7
99e5ccb
 
 
97a64e7
99e5ccb
 
 
 
97a64e7
 
99e5ccb
97a64e7
 
99e5ccb
 
 
 
 
 
 
 
 
 
97a64e7
99e5ccb
 
97a64e7
99e5ccb
 
97a64e7
99e5ccb
 
97a64e7
99e5ccb
97a64e7
 
99e5ccb
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

# --- 1. Base dependencies ---
RUN apt-get update && apt-get install -y \
    curl wget git sudo build-essential gnupg lsb-release \
    ca-certificates software-properties-common \
    python3 python3-pip python3-venv \
    nodejs npm \
    && rm -rf /var/lib/apt/lists/*

# --- 2. Add code-server ---
RUN curl -fsSL https://code-server.dev/install.sh | sh

# Create a new user for code-server
RUN useradd -m coder \
  && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# Set working dir
WORKDIR /home/coder

# Add code-server config (no auth for simplicity)
RUN mkdir -p /home/coder/.config/code-server
COPY --chown=coder:coder config.yaml /home/coder/.config/code-server/config.yaml

# Copy optional agent code
COPY . /home/coder/project

# Change ownership
RUN chown -R coder:coder /home/coder

# Switch to user
USER coder

# Expose the code-server port
EXPOSE 7860

# Start code-server
CMD ["code-server"]