tastypear commited on
Commit
2c34047
1 Parent(s): 4fc5bd8
Files changed (2) hide show
  1. Dockerfile +17 -0
  2. startup.sh +17 -0
Dockerfile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:latest
2
+
3
+ WORKDIR /codes
4
+
5
+ COPY . .
6
+
7
+ ENV GLIDER_VER="0.16.3"
8
+
9
+ RUN wget -nv https://github.com/nadoo/glider/releases/download/v${GLIDER_VER}/glider_${GLIDER_VER}_linux_amd64.tar.gz
10
+
11
+ RUN tar -xzvf glider_${GLIDER_VER}_linux_amd64.tar.gz --strip-components=1 glider_${GLIDER_VER}_linux_amd64/glider
12
+
13
+ RUN rm glider_${GLIDER_VER}_linux_amd64.tar.gz
14
+
15
+ RUN chmod +x ./glider
16
+
17
+ CMD ["bash","startup.sh"]
startup.sh ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # a little trick to avoid getting stuck on Starting
4
+ python -m http.server 7860 & kill $!
5
+
6
+ cat << EOF
7
+ This is a Tro${@}jan server demo.
8
+
9
+ Create the secrets below in Space Settings.
10
+ PASSWORD (*required)
11
+ WS_PATH (optional, eg: /api/path)
12
+
13
+ HOST is the direct domain of your Space, similar to [username-space-name.hf.space].
14
+ To confirm, you MUST set the Space to public and then click [...] - [Embed this Space].
15
+ EOF
16
+
17
+ ./glider -listen ws://:7860$WS_PATH,tro${@}janc://$PASSWORD@