vscode / Dockerfile
Techbitforge's picture
Update Dockerfile
3d47768 verified
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Update and install dependencies
RUN apt-get update && apt-get install -y \
sudo \
nano \
curl \
wget \
git \
python3 \
python3-pip \
git \
&& apt-get clean
# Install code-server properly
RUN curl -fsSL https://code-server.dev/install.sh | sh
# Work directory
WORKDIR /workspace
# Hugging Face will pass PASSWORD as an environment variable
# In HF Space β†’ Settings β†’ Variables β†’ add:
# PASSWORD = yourpassword
# ENV PASSWORD=""
# Expose Hugging Face port
EXPOSE 7860
# RUN git clone https://github.com/TECHBITFORGE-office/school_project.git
# 0929093
# Start VS Code server
# If PASSWORD isn't set, print error and exit (so you notice)
CMD bash -c ' \
if [ -z "$PASSWORD" ]; then \
echo "ERROR: PASSWORD env variable not set in Hugging Face Space settings."; \
exit 1; \
fi; \
code-server --bind-addr 0.0.0.0:7860 --auth password /workspace \
'