APINOW-service commited on
Commit
94d8d2d
·
verified ·
1 Parent(s): 6d78da9

Upload Dockerfile (2)

Browse files
Files changed (1) hide show
  1. Dockerfile (2) +44 -0
Dockerfile (2) ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ # Update and install dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ sudo \
8
+ nano \
9
+ curl \
10
+ wget \
11
+ git \
12
+ python3 \
13
+ python3-pip \
14
+ git \
15
+ && apt-get clean
16
+
17
+ # Install code-server properly
18
+ RUN curl -fsSL https://code-server.dev/install.sh | sh
19
+
20
+ # Work directory
21
+ WORKDIR /workspace
22
+
23
+ # Hugging Face will pass PASSWORD as an environment variable
24
+ # In HF Space → Settings → Variables → add:
25
+ # PASSWORD = yourpassword
26
+ # ENV PASSWORD=""
27
+
28
+ # Expose Hugging Face port
29
+ EXPOSE 7860
30
+
31
+
32
+ # RUN git clone https://github.com/TECHBITFORGE-office/school_project.git
33
+
34
+ # 0929093
35
+
36
+ # Start VS Code server
37
+ # If PASSWORD isn't set, print error and exit (so you notice)
38
+ CMD bash -c ' \
39
+ if [ -z "$PASSWORD" ]; then \
40
+ echo "ERROR: PASSWORD env variable not set in Hugging Face Space settings."; \
41
+ exit 1; \
42
+ fi; \
43
+ code-server --bind-addr 0.0.0.0:7860 --auth password /workspace \
44
+ '