crosse712
commited on
Commit
·
ace5c7e
1
Parent(s):
5bcaefa
Fix: Remove supervisor from Dockerfile to resolve HF Space security flag
Browse files- Replaced supervisor with simple bash script
- Using service command for nginx and exec for uvicorn
- This should resolve the 'malicious_process' detection
- Dockerfile +8 -36
Dockerfile
CHANGED
|
@@ -15,7 +15,6 @@ WORKDIR /app
|
|
| 15 |
# Install system dependencies
|
| 16 |
RUN apt-get update && apt-get install -y \
|
| 17 |
nginx \
|
| 18 |
-
supervisor \
|
| 19 |
libgomp1 \
|
| 20 |
libglib2.0-0 \
|
| 21 |
libsm6 \
|
|
@@ -60,44 +59,17 @@ RUN rm -f /etc/nginx/sites-enabled/default && \
|
|
| 60 |
} \
|
| 61 |
}' > /etc/nginx/sites-enabled/default
|
| 62 |
|
| 63 |
-
# Create
|
| 64 |
-
RUN mkdir -p /var/log
|
| 65 |
-
echo '[supervisord] \
|
| 66 |
-
nodaemon=true \
|
| 67 |
-
logfile=/var/log/supervisor/supervisord.log \
|
| 68 |
-
pidfile=/var/run/supervisord.pid \
|
| 69 |
-
\
|
| 70 |
-
[program:nginx] \
|
| 71 |
-
command=/usr/sbin/nginx -g "daemon off;" \
|
| 72 |
-
autostart=true \
|
| 73 |
-
autorestart=true \
|
| 74 |
-
priority=10 \
|
| 75 |
-
stdout_events_enabled=true \
|
| 76 |
-
stderr_events_enabled=true \
|
| 77 |
-
stdout_logfile=/dev/stdout \
|
| 78 |
-
stdout_logfile_maxbytes=0 \
|
| 79 |
-
stderr_logfile=/dev/stderr \
|
| 80 |
-
stderr_logfile_maxbytes=0 \
|
| 81 |
-
\
|
| 82 |
-
[program:backend] \
|
| 83 |
-
command=python -m uvicorn backend.app.main:app --host 127.0.0.1 --port 8000 --workers 1 \
|
| 84 |
-
directory=/app \
|
| 85 |
-
autostart=true \
|
| 86 |
-
autorestart=true \
|
| 87 |
-
priority=5 \
|
| 88 |
-
stdout_events_enabled=true \
|
| 89 |
-
stderr_events_enabled=true \
|
| 90 |
-
stdout_logfile=/dev/stdout \
|
| 91 |
-
stdout_logfile_maxbytes=0 \
|
| 92 |
-
stderr_logfile=/dev/stderr \
|
| 93 |
-
stderr_logfile_maxbytes=0 \
|
| 94 |
-
environment=USE_EXTREME_OPTIMIZATION="true",MAX_MEMORY_GB="3",PYTHONUNBUFFERED="1"' > /etc/supervisor/conf.d/supervisord.conf
|
| 95 |
|
| 96 |
-
# Create startup script
|
| 97 |
RUN echo '#!/bin/bash \
|
|
|
|
| 98 |
echo "Starting FastVLM Screen Observer..." \
|
| 99 |
-
echo "Starting
|
| 100 |
-
|
|
|
|
|
|
|
| 101 |
chmod +x /app/start.sh
|
| 102 |
|
| 103 |
# Expose port
|
|
|
|
| 15 |
# Install system dependencies
|
| 16 |
RUN apt-get update && apt-get install -y \
|
| 17 |
nginx \
|
|
|
|
| 18 |
libgomp1 \
|
| 19 |
libglib2.0-0 \
|
| 20 |
libsm6 \
|
|
|
|
| 59 |
} \
|
| 60 |
}' > /etc/nginx/sites-enabled/default
|
| 61 |
|
| 62 |
+
# Create startup script to run both services
|
| 63 |
+
RUN mkdir -p /var/log
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
# Create startup script to run both nginx and backend
|
| 66 |
RUN echo '#!/bin/bash \
|
| 67 |
+
set -e \
|
| 68 |
echo "Starting FastVLM Screen Observer..." \
|
| 69 |
+
echo "Starting nginx..." \
|
| 70 |
+
service nginx start \
|
| 71 |
+
echo "Starting backend API..." \
|
| 72 |
+
exec python -m uvicorn backend.app.main:app --host 127.0.0.1 --port 8000 --workers 1' > /app/start.sh && \
|
| 73 |
chmod +x /app/start.sh
|
| 74 |
|
| 75 |
# Expose port
|