shaliz-kong commited on
Commit
5bf514b
·
1 Parent(s): 397c16a

refactored dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -1
Dockerfile CHANGED
@@ -38,7 +38,9 @@ WORKDIR /app
38
  COPY scheduler_loop.py /app/scheduler_loop.py
39
 
40
  # ---- 8. copy supervisord config -------------------------------------------
41
- COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf # ADD THIS
 
 
42
 
43
  # ---- 9. start all services via supervisord --------------------------------
44
  CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
 
38
  COPY scheduler_loop.py /app/scheduler_loop.py
39
 
40
  # ---- 8. copy supervisord config -------------------------------------------
41
+ # Create supervisord config inside Docker build
42
+ RUN mkdir -p /etc/supervisor/conf.d && \
43
+ echo '[supervisord]\nnodaemon=true\n\n[program:redis]\ncommand=redis-server --bind 127.0.0.1 --port 6379 --maxmemory 128mb\nautostart=true\nautorestart=true\n\n[program:app]\ncommand=python -m uvicorn app.main:app --host 0.0.0.0 --port 7860\ndirectory=/app\nenvironment=REDIS_URL=redis://localhost:6379\nautostart=true\nautorestart=true\n\n[program:scheduler]\ncommand=python /app/scheduler_loop.py\ndirectory=/app\nenvironment=REDIS_URL=redis://localhost:6379\nautostart=true\nautorestart=true' > /etc/supervisor/conf.d/supervisord.conf
44
 
45
  # ---- 9. start all services via supervisord --------------------------------
46
  CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]