malt666 commited on
Commit
f3278b8
·
verified ·
1 Parent(s): 8aa86b2

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -0
Dockerfile CHANGED
@@ -229,6 +229,26 @@ ENTRYPOINT ["tini", "--", "sh", "-c", " \
229
 
230
  echo 'Starting SillyTavern server directly...'; \
231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  # --- BEGIN: Cleanup before start --- \
233
  # Remove .gitignore
234
  echo 'Attempting final removal of .gitignore...' && \
 
229
 
230
  echo 'Starting SillyTavern server directly...'; \
231
 
232
+ # --- BEGIN: Create and run keep-alive script --- \
233
+ echo '--- Creating keep-alive script love.sh ---'; \
234
+ cat << 'EOF' > ./love.sh && \
235
+ #!/bin/sh
236
+ # Keep SillyTavern alive for Hugging Face Spaces
237
+ while true; do
238
+ echo \"Sending keep-alive request to SillyTavern...\"
239
+ # Use -s for silent, -o /dev/null to discard output
240
+ curl -s http://localhost:8000/ > /dev/null
241
+ sleep 1800 # Sleep for 30 minutes (1800 seconds)
242
+ done
243
+ EOF
244
+ echo '--- Making love.sh executable ---'; \
245
+ chmod +x ./love.sh && \
246
+ echo '--- Running love.sh in background ---'; \
247
+ # Run in background and redirect stdout/stderr to a log file \
248
+ ./love.sh > ./love.log 2>&1 & \
249
+ echo '--- Keep-alive script started in background ---'; \
250
+ # --- END: Create and run keep-alive script --- \
251
+
252
  # --- BEGIN: Cleanup before start --- \
253
  # Remove .gitignore
254
  echo 'Attempting final removal of .gitignore...' && \