Charan5775 commited on
Commit
f71055b
·
verified ·
1 Parent(s): b07b28b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -4
Dockerfile CHANGED
@@ -1,6 +1,30 @@
1
- FROM kasmweb/kasm:1.15.0
 
2
 
3
- ENV KASM_PORT=3000
4
- EXPOSE 3000
 
 
 
5
 
6
- CMD ["/opt/kasm/current/bin/start"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WARNING: This will likely NOT work on Hugging Face Spaces due to DinD limitations
2
+ FROM ubuntu:22.04
3
 
4
+ # Install dependencies
5
+ RUN apt-get update && \
6
+ apt-get install -y curl wget gnupg2 ca-certificates software-properties-common && \
7
+ apt-get clean && \
8
+ rm -rf /var/lib/apt/lists/*
9
 
10
+ # Install Docker (required for Kasm, but Hugging Face won't allow DinD)
11
+ RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
12
+ sh get-docker.sh && \
13
+ usermod -aG docker root
14
+
15
+ # Install Kasm Workspaces
16
+ RUN curl -L https://kasm-static-content.s3.amazonaws.com/kasm_release_1.17.0.7f020d.tar.gz | tar xz -C /tmp && \
17
+ /tmp/install.sh -N
18
+
19
+ # Configure Kasm to use port 7860 for Hugging Face compatibility
20
+ RUN sed -i 's/PORT=3000/PORT=7860/g' /opt/kasm/config/nginx.conf
21
+
22
+ # Expose required port
23
+ EXPOSE 7860
24
+
25
+ # Health check
26
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
27
+ CMD curl -f http://localhost:7860/health || exit 1
28
+
29
+ # Start Kasm services
30
+ CMD ["/opt/kasm/bin/start"]