KarlQuant commited on
Commit
5051824
Β·
verified Β·
1 Parent(s): fa10b19

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +59 -39
Dockerfile CHANGED
@@ -1,46 +1,66 @@
1
- # Use official Python 3.11 slim image
2
- FROM python:3.11-slim
 
 
 
 
 
3
 
4
- WORKDIR /app
 
5
 
6
- # Install system dependencies
7
- RUN apt-get update && apt-get install -y --no-install-recommends \
8
- build-essential \
9
- git \
10
- curl \
11
- wget \
12
- supervisor \
13
- && rm -rf /var/lib/apt/lists/*
14
 
15
- # ── Remove ALL default supervisor configs shipped by apt ──────────────────────
16
- RUN rm -f /etc/supervisor/supervisord.conf \
17
- /etc/supervisor/conf.d/*.conf
18
 
19
- # Copy requirements first (for layer caching)
20
- COPY requirements.txt .
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
- # Install Python dependencies
23
- RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
24
- pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
25
 
26
- # Copy application code
27
- COPY . .
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- # ── Place our supervisor config at the root level so it is fully standalone ──
30
- COPY supervisord.conf /etc/supervisord.conf
31
- RUN chmod 644 /etc/supervisord.conf
32
-
33
- # ── Copy and permission the entrypoint cleanup script ────────────────────────
34
- COPY entrypoint.sh /entrypoint.sh
35
- RUN chmod +x /entrypoint.sh
36
-
37
- # Logs directory
38
- RUN mkdir -p /app/logs && chmod 777 /app/logs
39
-
40
- # Expose only the ports our app actually uses
41
- EXPOSE 7860
42
-
43
- USER root
44
-
45
- # Entrypoint cleans up stale state, then execs supervisord
46
- CMD ["/entrypoint.sh"]
 
1
+ [supervisord]
2
+ nodaemon=true
3
+ user=root
4
+ logfile=/dev/null
5
+ logfile_maxbytes=0
6
+ pidfile=/tmp/supervisord.pid
7
+ loglevel=info
8
 
9
+ [supervisorctl]
10
+ serverurl=unix:///tmp/supervisor.sock
11
 
12
+ [unix_http_server]
13
+ file=/tmp/supervisor.sock
14
+ chmod=0700
 
 
 
 
 
15
 
16
+ [rpcinterface:supervisor]
17
+ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
 
18
 
19
+ [program:app]
20
+ command=python /app/websocket_hub.py
21
+ directory=/app
22
+ autostart=true
23
+ autorestart=true
24
+ startsecs=5
25
+ startretries=10
26
+ stopasgroup=true
27
+ killasgroup=true
28
+ stdout_logfile=/dev/stdout
29
+ stdout_logfile_maxbytes=0
30
+ stderr_logfile=/dev/stderr
31
+ stderr_logfile_maxbytes=0
32
+ environment=PORT=7860,DASHBOARD_HTML=/app/hub_dashboard.html,PYTHONUNBUFFERED=1
33
 
34
+ [program:worker1]
35
+ command=python /app/Quasar_axrvi_ranker.py --hub ws://localhost:7860/ws/subscribe --sync
36
+ directory=/app
37
+ autostart=true
38
+ autorestart=true
39
+ startsecs=5
40
+ startretries=10
41
+ stopasgroup=true
42
+ killasgroup=true
43
+ stdout_logfile=/dev/stdout
44
+ stdout_logfile_maxbytes=0
45
+ stderr_logfile=/dev/stderr
46
+ stderr_logfile_maxbytes=0
47
+ environment=PYTHONUNBUFFERED=1
48
 
49
+ [program:dashboard]
50
+ command=python3 /app/hub_dashboard_service.py
51
+ directory=/app
52
+ autostart=true
53
+ autorestart=true
54
+ startsecs=5
55
+ startretries=10
56
+ stopasgroup=true
57
+ killasgroup=true
58
+ stdout_logfile=/dev/stdout
59
+ stdout_logfile_maxbytes=0
60
+ stderr_logfile=/dev/stderr
61
+ stderr_logfile_maxbytes=0
62
+ environment=PYTHONUNBUFFERED=1,DASHBOARD_HTML=/app/hub_dashboard.html,RANKER_LOG_DIR=/app/ranker_logs,DASHBOARD_PORT=8051
63
 
64
+ [group:space]
65
+ programs=app,worker1,dashboard
66
+ priority=999