1
+ # Use the provided base image
2
+ FROM ghcr.io/berriai/litellm:main-latest
3
+
4
+ # Set the working directory to /app
5
+ WORKDIR /app
6
+
7
+ # Install Node.js and npm (adjust version as needed)
8
+ RUN apt-get update && apt-get install -y nodejs npm
9
+
10
+ # Copy the UI source into the container
11
+ COPY ./ui/litellm-dashboard /app/ui/litellm-dashboard
12
+
13
+ # Set an environment variable for UI_BASE_PATH
14
+ # This can be overridden at build time
15
+ ENV UI_BASE_PATH="/genai/ui"
16
+
17
+ # Build the UI with the specified UI_BASE_PATH
18
+ WORKDIR /app/ui/litellm-dashboard
19
+ RUN npm install
20
+ RUN UI_BASE_PATH=$UI_BASE_PATH npm run build
21
+
22
+ # Create the destination directory
23
+ RUN mkdir -p /app/litellm/proxy/_experimental/out
24
+
25
+ # Move the built files to the appropriate location
26
+ # Assuming the build output is in ./out directory
27
+ RUN rm -rf /app/litellm/proxy/_experimental/out/* && \
28
+ mv ./out/* /app/litellm/proxy/_experimental/out/
29
+
30
+ # Switch back to the main app directory
31
+ WORKDIR /app
32
+
33
+ # Make sure your entrypoint.sh is executable
34
+ RUN chmod +x entrypoint.sh
35
+
36
+ # Expose the necessary port
37
+ EXPOSE 4000/tcp
38
+
39
+ # Override the CMD instruction with your desired command and arguments
40
+ CMD ["--port", "4000", "--config", "config.yaml", "--detailed_debug"]
0 commit comments