abhinand commited on
Commit
4d0a7ec
·
verified ·
1 Parent(s): b5ed819

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -14
Dockerfile CHANGED
@@ -1,26 +1,23 @@
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 read their values in a 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 "TOGETHER_API_KEY=${TOGETHER_API_KEY}" >> /build_secrets && \
14
- echo "GROQ_API_KEY=${GROQ_API_KEY}" >> /build_secrets && \
15
- echo "REMOTE_DB_URI=${REMOTE_DB_URI}" >> /build_secrets
16
 
17
- # Read the secrets from the temporary file and set them as environment variables
18
- RUN set -a && \
19
- source /build_secrets
20
 
21
- # Ensure the environment variables are set at runtime
22
- ENV OPENAI_API_KEYS="${TOGETHER_API_KEY};${GROQ_API_KEY}"
23
- ENV DATABASE_URL="${REMOTE_DB_URI}"
24
 
25
- # Expose necessary port
 
 
 
26
  EXPOSE 8080
 
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
3
+ # Set static environment variables
4
  ENV OPENAI_API_BASE_URLS="https://api.together.xyz/v1;https://api.groq.com/openai/v1"
5
 
6
  # Mount secrets and read their values in a 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
+ mkdir -p /run/secrets && \
11
+ cp /run/secrets/TOGETHER_API_KEY /run/secrets/GROQ_API_KEY /run/secrets/REMOTE_DB_URI /tmp/secrets/
 
 
 
 
12
 
13
+ # Copy the entrypoint script
14
+ COPY entrypoint.sh /usr/local/bin/
 
15
 
16
+ # Make the entrypoint script executable
17
+ RUN chmod +x /usr/local/bin/entrypoint.sh
 
18
 
19
+ # Set the entrypoint
20
+ ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
21
+
22
+ # Expose the necessary port
23
  EXPOSE 8080