File size: 980 Bytes
06fe404
 
 
 
 
 
d773c6d
 
06fe404
 
 
 
 
57fd46b
06fe404
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57fd46b
d773c6d
57fd46b
3d47768
50e4c5f
06fe404
 
 
 
 
 
 
 
 
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
33
34
35
36
37
38
39
40
41
42
43
44
45
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 \
'