-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·34 lines (23 loc) · 1.16 KB
/
Dockerfile
File metadata and controls
executable file
·34 lines (23 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM python:3.11-slim
LABEL org.opencontainers.image.title="SmarterRouter"
LABEL org.opencontainers.image.description="AI-powered LLM router that intelligently selects the best model"
LABEL org.opencontainers.image.url="https://github.com/peva3/SmarterRouter"
LABEL org.opencontainers.image.source="https://github.com/peva3/SmarterRouter"
LABEL org.opencontainers.image.licenses="MIT"
WORKDIR /app
RUN pip install --no-cache-dir --upgrade pip
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN chmod +x /app/router/entrypoint.py
RUN useradd --create-home --shell /bin/bash router \
&& chown -R router:router /app \
&& mkdir -p /app/data \
&& chown router:router /app/data
# Note: We don't use USER here because we need to handle volume permissions at runtime
# The entrypoint will switch to the router user after setting up permissions
EXPOSE 11436
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:11436/health')" || exit 1
# Set entrypoint for automatic configuration
ENTRYPOINT ["python", "-m", "router.entrypoint"]