Spaces:
Running
Running
Commit ·
5de1239
1
Parent(s): 113afb7
Configure and deploy media-processor-service to the new Space
Browse files- Dockerfile +0 -1
- start.sh +1 -29
Dockerfile
CHANGED
|
@@ -12,7 +12,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 12 |
fonts-dejavu-core \
|
| 13 |
fonts-liberation \
|
| 14 |
curl \
|
| 15 |
-
tor \
|
| 16 |
nodejs \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
|
|
|
| 12 |
fonts-dejavu-core \
|
| 13 |
fonts-liberation \
|
| 14 |
curl \
|
|
|
|
| 15 |
nodejs \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
start.sh
CHANGED
|
@@ -1,32 +1,4 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
-
# Start
|
| 3 |
-
echo "[startup] Starting Tor daemon..."
|
| 4 |
-
mkdir -p /tmp/tor-data
|
| 5 |
-
chmod 700 /tmp/tor-data
|
| 6 |
-
tor --RunAsDaemon 1 --SocksPort 127.0.0.1:9050 --DataDirectory /tmp/tor-data --PidFile /tmp/tor.pid --Log "notice file /tmp/tor.log"
|
| 7 |
-
|
| 8 |
-
# Wait for Tor to bootstrap
|
| 9 |
-
echo "[startup] Checking Tor connection..."
|
| 10 |
-
BOOTSTRAPPED=false
|
| 11 |
-
for i in {1..20}; do
|
| 12 |
-
if curl --connect-timeout 2 -sI -x socks5h://127.0.0.1:9050 https://www.google.com >/dev/null; then
|
| 13 |
-
echo "[startup] Tor proxy is ready and routing traffic!"
|
| 14 |
-
BOOTSTRAPPED=true
|
| 15 |
-
break
|
| 16 |
-
fi
|
| 17 |
-
echo "[startup] Tor is bootstrapping, waiting..."
|
| 18 |
-
sleep 2
|
| 19 |
-
done
|
| 20 |
-
|
| 21 |
-
if [ "$BOOTSTRAPPED" = false ]; then
|
| 22 |
-
echo "[startup] Tor failed to bootstrap within 40 seconds."
|
| 23 |
-
fi
|
| 24 |
-
|
| 25 |
-
# Print Tor log for debugging
|
| 26 |
-
echo "=== Tor Log Start ==="
|
| 27 |
-
cat /tmp/tor.log 2>/dev/null || echo "No Tor log found"
|
| 28 |
-
echo "=== Tor Log End ==="
|
| 29 |
-
|
| 30 |
-
# Start Gunicorn application
|
| 31 |
echo "[startup] Starting Gunicorn server..."
|
| 32 |
exec gunicorn --bind 0.0.0.0:7860 --workers 1 --threads 4 --timeout 300 --access-logfile - app:app
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
+
# Start Gunicorn application directly (Tor disabled for Hugging Face policy compliance)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
echo "[startup] Starting Gunicorn server..."
|
| 4 |
exec gunicorn --bind 0.0.0.0:7860 --workers 1 --threads 4 --timeout 300 --access-logfile - app:app
|