Spaces:
Paused

File size: 1,091 Bytes
224df1b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
41
42
43
FROM debian:bookworm-slim

# Prevent prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install core dependencies
RUN apt-get update && apt-get install -y \
    curl \
    wget \
    git \
    python3 \
    python3-pip \
    sudo \
    lsb-release \
    net-tools \
    &> /dev/null

# Install code-server (The Agent's Interface)
RUN curl -fsSL https://code-server.dev/install.sh | sh

# Install Cloudflared (The Tunnel)
RUN curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && \
    dpkg -i cloudflared.deb && \
    rm cloudflared.deb

# Create a non-root user 'puppet' for HF compliance
RUN useradd -m -s /bin/bash puppet && \
    echo "puppet ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

USER puppet
WORKDIR /home/puppet

# Prepare Agent workspace
RUN mkdir -p /home/puppet/agent_workspace

# Copy the orchestration script
COPY --chown=puppet:puppet entrypoint.sh /home/puppet/entrypoint.sh
RUN chmod +x /home/puppet/entrypoint.sh

# HF Spaces default port is 7860
EXPOSE 7860

ENTRYPOINT ["/home/puppet/entrypoint.sh"]