Benjamin Bossan commited on
Commit
308c6f6
1 Parent(s): 3fe3d12

Try fixing timeout of space

Browse files
Files changed (3) hide show
  1. Dockerfile +3 -3
  2. start.sh +1 -1
  3. start2.sh +21 -0
Dockerfile CHANGED
@@ -24,7 +24,7 @@ RUN python3 -m pip install .
24
 
25
  COPY --chown=user "demo.py" .
26
  EXPOSE 7860 8080
27
- COPY --chown=user start.sh .
28
- RUN chmod +x start.sh
29
 
30
- CMD ["./start.sh"]
 
24
 
25
  COPY --chown=user "demo.py" .
26
  EXPOSE 7860 8080
27
+ COPY --chown=user start2.sh .
28
+ RUN chmod +x start2.sh
29
 
30
+ CMD ["./start2.sh"]
start.sh CHANGED
@@ -5,7 +5,7 @@ python3 src/gistillery/worker.py &
5
  pid_worker=$!
6
 
7
  echo "Starting web server"
8
- uvicorn src.gistillery.webservice:app --port 8080 --host=0.0.0.0 &
9
  pid_webserver=$!
10
 
11
  # kill with ctrl-c
 
5
  pid_worker=$!
6
 
7
  echo "Starting web server"
8
+ uvicorn src.gistillery.webservice:app --port 8080 --host 0.0.0.0 &
9
  pid_webserver=$!
10
 
11
  # kill with ctrl-c
start2.sh ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ echo "Starting gradio app on default port 7860"
4
+ python3 demo.py &
5
+ pid_gradio=$!
6
+
7
+ echo "Starting web server"
8
+ uvicorn src.gistillery.webservice:app --port 8080 --host 0.0.0.0 &
9
+ pid_webserver=$!
10
+
11
+ # kill with ctrl-c
12
+ trap onexit INT
13
+ function onexit() {
14
+ echo "Killing background worker"
15
+ kill $pid_gradio
16
+ echo "Killing web server"
17
+ kill $pid_webserver
18
+ }
19
+
20
+ echo "Starting background worker"
21
+ python src/gistillery/worker.py