diff --git a/valhub/Dockerfile b/valhub/Dockerfile index ce0628b4..f84ffa37 100644 --- a/valhub/Dockerfile +++ b/valhub/Dockerfile @@ -22,10 +22,6 @@ RUN apt-get install -y libpq-dev python3-psycopg2 RUN apt-get --assume-yes install mariadb-client supervisor postgresql-client RUN apt-get --assume-yes install python3-dev default-libmysqlclient-dev build-essential pkg-config RUN python3 -m pip install --upgrade pip -WORKDIR /root/valhub RUN python3 -m pip install -r requirements.txt -# RUN cd ./valhub -# RUN python3 manage.py makemigrations -# RUN python3 manage.py collectstatic --noinput -CMD ["/usr/bin/supervisord", "-c", "/root/valhub/supervisord.conf"] +CMD ["/bin/bash", "/root/valhub/startup.sh"] diff --git a/valhub/startup.sh b/valhub/startup.sh index 0d8797f3..bbaa598e 100644 --- a/valhub/startup.sh +++ b/valhub/startup.sh @@ -31,6 +31,9 @@ echo "Creating superuser..." echo "Superuser already exists, skipping creation." } -# Run valhub_webserver -echo "Starting webserver..." -python3 manage.py runserver 0.0.0.0:8005 \ No newline at end of file +# Starting supervisord +echo "Starting supervisord..." +supervisord -c /root/valhub/supervisord.conf -n + +# # Keep the container running +# tail -f /dev/null \ No newline at end of file diff --git a/valhub/supervisord.conf b/valhub/supervisord.conf index 6b57fbda..dfe0fcec 100644 --- a/valhub/supervisord.conf +++ b/valhub/supervisord.conf @@ -2,7 +2,11 @@ nodaemon = true loglevel = debug -[program:startup] -command=/bin/bash /root/valhub/startup.sh +[program:valhub_webserver] +directory=/root/valhub +command=python3 /root/valhub/manage.py runserver 0.0.0.0:8005 +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +redirect_stderr=true autostart=true -autorestart=false +autorestart=true \ No newline at end of file