-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.dev
More file actions
58 lines (43 loc) · 1.73 KB
/
Dockerfile.dev
File metadata and controls
58 lines (43 loc) · 1.73 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Development Dockerfile with hot-reload support
FROM nikolaik/python-nodejs:python3.10-nodejs18-slim
# Set environment variables
ENV APP_HOME=/usr/src/app \
PATH=/home/pn/.local/bin:$PATH \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# Set working directory
WORKDIR $APP_HOME
# Install system dependencies (curl for health checks, PostgreSQL client)
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
libpq-dev \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Copy dependency files first for better caching
COPY requirements.txt package*.json ./
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt
RUN prisma generate --schema $(python -c "import pathlib, litellm.proxy; print(pathlib.Path(litellm.proxy.__file__).parent / 'schema.prisma')") \
&& chmod a+rx /root /root/.cache && chmod -R a+rX /root/.cache/prisma-python
# Apply patches to litellm (unmerged fixes)
COPY patches/ /tmp/patches/
RUN cp /tmp/patches/litellm_azure_realtime.py /usr/local/lib/python3.10/site-packages/litellm/llms/azure/realtime/handler.py
# Install Node dependencies
RUN npm install
# Copy scripts
COPY entrypoint.sh /entrypoint.sh
COPY start.sh /start.sh
RUN chmod +x /entrypoint.sh /start.sh
# Create directories and set permissions
RUN mkdir -p /home/pn/.cache $APP_HOME/staticfiles && \
chown -R pn:pn /home/pn/.cache $APP_HOME
RUN mkdir -p /var/lib/litellm/ui /var/lib/litellm/assets && chown -R pn:pn /var/lib/litellm
# Switch to non-root user
USER pn
# Expose ports
EXPOSE 8000 4000
# Entrypoint runs migrations, sets up LiteLLM DB, collectstatic
ENTRYPOINT ["/entrypoint.sh"]
# Default command - can be overridden in docker-compose
CMD ["/start.sh"]