How to run a Redis server AND another application inside Docker?

后端 未结 3 1269
执念已碎
执念已碎 2021-02-14 11:42

I created a Django application which runs inside a Docker container. I needed to create a thread inside the Django application so I used Celery and Redis as the Celery Database.

3条回答
  •  面向向阳花
    2021-02-14 12:17

    use supervisord which would control both processes. The conf file might look like this:

    ...
    [program:redis]
    command= /usr/bin/redis-server /srv/redis/redis.conf
    stdout_logfile=/var/log/supervisor/redis-server.log
    stderr_logfile=/var/log/supervisor/redis-server_err.log
    autorestart=true
    
    [program:nginx]
    command=/usr/sbin/nginx
    stdout_events_enabled=true
    stderr_events_enabled=true
    

提交回复
热议问题