Spaces:
Sleeping
Sleeping
File size: 894 Bytes
0bba2e9 4af0180 0bba2e9 4af0180 0bba2e9 4af0180 0bba2e9 4af0180 0bba2e9 4af0180 | 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 | FROM python:3.11-slim
# ---- system deps ----
RUN apt-get update && apt-get install -y \
curl wget git htop nano vim sudo \
build-essential net-tools procps \
&& curl -fsSL https://code-server.dev/install.sh | sh \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# ---- python deps ----
RUN pip install --no-cache-dir \
requests ipython huggingface_hub transformers
# ---- create user WITH PASSWORD + sudo ----
RUN useradd -m -u 1000 -s /bin/bash user \
&& echo "user:user123" | chpasswd \
&& usermod -aG sudo user \
&& echo "user ALL=(ALL) ALL" > /etc/sudoers.d/user \
&& chmod 0440 /etc/sudoers.d/user
# ---- runtime ----
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR /home/user
RUN mkdir -p /home/user/workspace
EXPOSE 7860
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "/home/user/workspace"]
|