Update docker to use supervisor
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -27,7 +27,8 @@ RUN apt-get update && \
|
||||
libpulse-dev \
|
||||
apulse \
|
||||
ffmpeg \
|
||||
liquidsoap
|
||||
liquidsoap \
|
||||
supervisor
|
||||
|
||||
# Clone the boatbod op25 repository
|
||||
RUN git clone -b gr310 https://github.com/boatbod/op25 /op25
|
||||
@@ -41,10 +42,6 @@ RUN ./install.sh -f
|
||||
# Update the liquid file
|
||||
COPY op25.liq /op25/op25.liq
|
||||
|
||||
# Enable the liquidsoap service
|
||||
COPY op25-liq.service /etc/systemd/system
|
||||
RUN systemctl enable op25-liq
|
||||
|
||||
# Install Python dependencies
|
||||
COPY requirements.txt /tmp/requirements.txt
|
||||
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
|
||||
@@ -74,5 +71,8 @@ COPY ./app/internal/opus /app/internal/opus
|
||||
# Copy the rest of the directory contents into the container at /app
|
||||
COPY ./app /app
|
||||
|
||||
# Run the node script
|
||||
ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001", "--reload"]
|
||||
# Add Supervisord configuration
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# Modify the ENTRYPOINT to run Supervisord
|
||||
ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
@@ -1,15 +0,0 @@
|
||||
[Unit]
|
||||
Description=op25-liq
|
||||
After=syslog.target network.target nss-lookup.target network-online.target
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
User=1000
|
||||
Group=1000
|
||||
WorkingDirectory=/op25/op25/gr-op25_repeater/apps
|
||||
ExecStart=/usr/bin/liquidsoap op25.liq
|
||||
RestartSec=5
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
20
supervisord.conf
Normal file
20
supervisord.conf
Normal file
@@ -0,0 +1,20 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
|
||||
[program:op25-liq]
|
||||
command=/usr/bin/liquidsoap /op25/op25.liq
|
||||
directory=/op25
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stderr_logfile=/var/log/supervisor/op25-liq.err.log
|
||||
stdout_logfile=/var/log/supervisor/op25-liq.out.log
|
||||
user=root
|
||||
|
||||
[program:drb-client-discord]
|
||||
command=uvicorn main:app --host 0.0.0.0 --port 8001 --reload
|
||||
directory=/app
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stderr_logfile=/var/log/supervisor/main_app.err.log
|
||||
stdout_logfile=/var/log/supervisor/main_app.out.log
|
||||
user=root
|
||||
Reference in New Issue
Block a user