Spaces:
Paused
Paused
| FROM ubuntu:22.04 | |
| # Avoid prompts during apt installs | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Update and install dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| git \ | |
| wget \ | |
| sudo \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| build-essential \ | |
| cmake \ | |
| libjson-c-dev \ | |
| libwebsockets-dev \ | |
| sshfs \ | |
| fuse \ | |
| dos2unix \ | |
| nano \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Enable FUSE for non-root users | |
| RUN echo "user_allow_other" >> /etc/fuse.conf | |
| # Install ttyd from source or pre-compiled binary | |
| RUN wget https://github.com/tsl0922/ttyd/releases/download/1.7.4/ttyd.x86_64 -O /usr/local/bin/ttyd && \ | |
| chmod +x /usr/local/bin/ttyd | |
| # Create user with UID 1000 | |
| RUN useradd -m -s /bin/bash -u 1000 user && \ | |
| usermod -aG sudo user && \ | |
| echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | |
| # Setup working directory | |
| WORKDIR /code | |
| COPY --chown=user:user . /code | |
| RUN chmod +x /code/*.sh || true && \ | |
| dos2unix /code/*.sh || true | |
| USER user | |
| ENV HOME=/home/user | |
| ENV PATH=/home/user/.local/bin:$PATH | |
| # Start ttyd on port 7860, running bash | |
| CMD ["ttyd", "-p", "7860", "-W", "bash"] | |