Skip to content

Commit

Permalink
Moved supervisord to bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellAV committed Dec 6, 2024
1 parent 7e0928b commit 4e490a6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 1 addition & 5 deletions valhub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
9 changes: 6 additions & 3 deletions valhub/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# Starting supervisord
echo "Starting supervisord..."
supervisord -c /root/valhub/supervisord.conf -n

# # Keep the container running
# tail -f /dev/null
10 changes: 7 additions & 3 deletions valhub/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4e490a6

Please sign in to comment.