| |
| FROM ubuntu:24.04 |
|
|
| ENV DEBIAN_FRONTEND=noninteractive \ |
| LANG=C.UTF-8 |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| curl ca-certificates gnupg git git-lfs build-essential \ |
| python3 python3-pip sudo openssh-client unzip vim nano \ |
| && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ |
| && apt-get install -y --no-install-recommends nodejs \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN curl -fsSL https://code-server.dev/install.sh | sh |
|
|
| |
| RUN npm install -g @anthropic-ai/claude-code @openai/codex \ |
| && npm cache clean --force |
|
|
| |
| |
| |
| RUN existing_uid_1000="$(getent passwd 1000 | cut -d: -f1)"; \ |
| if [ -n "$existing_uid_1000" ]; then userdel -r "$existing_uid_1000" 2>/dev/null || true; fi \ |
| && useradd -m -u 1000 -s /bin/bash user \ |
| && echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user \ |
| && mkdir -p /data && chown user:user /data |
|
|
| USER user |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH |
| WORKDIR /home/user |
|
|
| COPY --chown=user:user entrypoint.sh /home/user/entrypoint.sh |
| RUN chmod +x /home/user/entrypoint.sh |
|
|
| |
| EXPOSE 7860 |
|
|
| ENTRYPOINT ["/home/user/entrypoint.sh"] |
|
|