VSCode-IDE-2 / Dockerfile
userbymahadi's picture
Update Dockerfile
4462b60 verified
Raw
History Blame Contribute Delete
1.07 kB
FROM python:3.9-slim-bullseye
# Install necessary tools (curl, git, sudo, etc.)
RUN apt-get update && apt-get install -y \
curl \
git \
sudo \
sqlite3 \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Latest Current Node.js Version (v26.x) via NodeSource
RUN curl -fsSL https://deb.nodesource.com/setup_current.x | bash - && \
apt-get install -y nodejs
# Install latest npm and Gemini CLI globally
RUN npm install -g npm@latest && \
npm install -g @google/gemini-cli
# Install code-server (Web version of VSCode)
RUN curl -fsSL https://code-server.dev/install.sh | sh
# Create a non-root user for security purposes
RUN useradd -m -u 1000 user && \
echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Hugging Face Space uses port 7860
ENV PORT=7860
EXPOSE 7860
# Set working directory
WORKDIR /home/user
# Copy entrypoint script and grant execution permissions
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Switch to non-root user
USER user
# Execution command
ENTRYPOINT ["/entrypoint.sh"]