improve dockerfile
This commit is contained in:
parent
105b66d5e2
commit
eade509947
|
@ -59,14 +59,18 @@ COPY --from=build /app /app
|
|||
COPY --from=build /jupyterlab /jupyterlab
|
||||
RUN cp /local-llm-server/other/vllm/Docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
RUN echo '#!/bin/bash\n/venv/bin/python /local-llm-server/other/vllm/vllm_api_server.py --host 0.0.0.0 --port 7000 $(cat /storage/vllm/cmd.txt)' > /app/start-vllm.sh
|
||||
RUN echo '' > /app/start-vllm.sh
|
||||
|
||||
COPY ./rathole-client.toml /app/client.toml
|
||||
COPY ./jupyter /app/jupyter
|
||||
COPY ./ssh /root/.ssh
|
||||
COPY ./start-container.sh /app/start.sh
|
||||
|
||||
RUN mkdir -p /var/log/app/
|
||||
|
||||
RUN chown -R apiserver:apiserver /local-llm-server && \
|
||||
chown -R apiserver:apiserver /app
|
||||
chown -R apiserver:apiserver /app && \
|
||||
chown -R apiserver:apiserver /var/log/app/
|
||||
|
||||
ENV SHELL="/bin/bash"
|
||||
|
||||
|
@ -79,4 +83,4 @@ EXPOSE 7000
|
|||
# Jupyter
|
||||
EXPOSE 8888
|
||||
|
||||
CMD /usr/bin/supervisord
|
||||
CMD /app/start.sh
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p /storage/vllm/
|
||||
chown -R apiserver:apiserver /storage/vllm
|
||||
touch /storage/vllm/cmd.txt
|
||||
|
||||
/usr/bin/supervisord
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Kill old processes
|
||||
pids1=$(ps aux | grep '[b]ash /app/start-vllm.sh' | awk '{print $2}')
|
||||
pids2=$(ps aux | grep '/venv/bin/python /local-llm-server/other/vllm/vllm_api_server.py' | awk '{print $2}')
|
||||
|
||||
# Kill the processes
|
||||
for pid in $pids1; do
|
||||
kill -9 $pid
|
||||
done
|
||||
|
||||
for pid in $pids2; do
|
||||
kill -9 $pid
|
||||
done
|
||||
|
||||
/venv/bin/python /local-llm-server/other/vllm/vllm_api_server.py --host 0.0.0.0 --port 7000 $(cat /storage/vllm/cmd.txt)
|
|
@ -2,7 +2,7 @@
|
|||
nodaemon=true
|
||||
|
||||
[program:api_server]
|
||||
command=bash /app/start-vllm.sh
|
||||
command=bash /app/start-vllm.sh 2>&1 | tee /var/log/app/vllm.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/fd/1
|
||||
|
@ -13,7 +13,7 @@ user=apiserver
|
|||
environment=HOME="/home/apiserver",USER="apiserver"
|
||||
|
||||
[program:proxy]
|
||||
command=/app/rathole -c /app/client.toml
|
||||
command=/app/rathole -c /app/client.toml 2>&1 | tee /var/log/app/rathole.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/fd/1
|
||||
|
|
Reference in New Issue