File tree Expand file tree Collapse file tree 3 files changed +35
-19
lines changed
Expand file tree Collapse file tree 3 files changed +35
-19
lines changed Original file line number Diff line number Diff line change 1- FROM python:3.13.7 -slim-trixie
1+ FROM python:3.13.9 -slim-trixie
22
33ARG version=prod
44ARG GIT_REF=main
@@ -14,21 +14,17 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y supervisor htop c
1414
1515WORKDIR /srv/
1616
17-
1817RUN git clone https://github.com/radlab-dev-group/llm-router.git && \
1918 cd /srv/llm-router && \
20- git checkout ${GIT_REF} && \
21- cat .git/HEAD > .version && git log -1 | head -1 >> .version && \
22- rm -rf .git .gitignore
19+ git checkout ${GIT_REF}
2320
2421WORKDIR /srv/llm-router
2522
26- RUN pip3 install --upgrade pip && pip3 install -r requirements.txt
27-
28- RUN pip3 install git+https://github.com/radlab-dev-group/ml-utils.git
23+ RUN pip3 install --upgrade pip
24+ RUN pip3 install --no-cache-dir .
25+ RUN pip3 install --no-cache-dir .[api]
2926
27+ COPY entrypoint.sh entrypoint.sh
3028RUN chmod +x run-rest-api.sh && chmod +x entrypoint.sh
3129
32- RUN cd llm_router_web && pip3 install -r requirements.txt && cd ..
33-
3430ENTRYPOINT ["/srv/llm-router/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22set -e
33
4- if [ " $1 " = " SLEEP" ]; then
5- echo " [Entrypoint] Debug mode: sleeping indefinitely..."
6- sleep infinity
4+ # Default values
5+ APP_SCRIPT=" run-rest-api-gunicorn.sh"
6+ DEBUG_MODE=false
7+
8+ for arg in " $@ " ; do
9+ case " $arg " in
10+ --debug|debug|--shell|shell)
11+ DEBUG_MODE=true
12+ ;;
13+ --runserver|runserver)
14+ APP_SCRIPT=" run-rest-api.sh"
15+ ;;
16+ esac
17+ done
18+
19+ echo " [entrypoint] Working directory: $( pwd) "
20+
21+ if [ " $DEBUG_MODE " = true ]; then
22+ echo " [entrypoint] Debug mode activated. Container will stay alive for exec."
23+ sleep infinity
24+ exit 0
725fi
826
9- echo " [Entrypoint] Creating supervisord.conf ..."
10- envsubst < docker/supervisord.conf.template > /etc/supervisor/conf.d/supervisord.conf
27+ if [ ! -f " ./$APP_SCRIPT " ]; then
28+ echo " [entrypoint] ERROR: Script $APP_SCRIPT not found!"
29+ exit 1
30+ fi
1131
12- echo " [Entrypoint ] Starting supervisord ..."
13- supervisord
32+ echo " [entrypoint ] Starting application using $APP_SCRIPT ..."
33+ exec " ./ $APP_SCRIPT "
Original file line number Diff line number Diff line change 22gunicorn
33redis
44prometheus_client
5-
5+ python-dateutil
66# gevent
You can’t perform that action at this time.
0 commit comments