abhinand commited on
Commit
51fc63b
·
verified ·
1 Parent(s): 161636f

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ghcr.io/open-webui/open-webui:main
2
+
3
+ # Set the API base URLs as an environment variable
4
+ ENV OPENAI_API_BASE_URLS="https://api.together.xyz/v1;https://api.groq.com/openai/v1"
5
+
6
+ # Mount secrets and set environment variables in one RUN command
7
+ RUN --mount=type=secret,id=TOGETHER_API_KEY,mode=0444,required=true \
8
+ --mount=type=secret,id=GROQ_API_KEY,mode=0444,required=true \
9
+ --mount=type=secret,id=REMOTE_DB_URI,mode=0444,required=true \
10
+ TOGETHER_API_KEY=$(cat /run/secrets/TOGETHER_API_KEY) && \
11
+ GROQ_API_KEY=$(cat /run/secrets/GROQ_API_KEY) && \
12
+ REMOTE_DB_URI=$(cat /run/secrets/REMOTE_DB_URI) && \
13
+ echo "OPENAI_API_KEYS=${TOGETHER_API_KEY};${GROQ_API_KEY}" >> /root/.bashrc && \
14
+ echo "REMOTE_DB_URI=${REMOTE_DB_URI}" >> /root/.bashrc
15
+
16
+ # Set permissions for the app directory
17
+ RUN chmod -R 777 /app/backend
18
+ VOLUME /app/backend/data
19
+
20
+ # Set environment variables for runtime
21
+ ENV OPENAI_API_KEYS="${TOGETHER_API_KEY};${GROQ_API_KEY}"
22
+ ENV REMOTE_DB_URI="${REMOTE_DB_URI}"
23
+
24
+ # Expose necessary port
25
+ EXPOSE 8080