Robaa commited on
Commit
c5b0317
·
1 Parent(s): 46f1efa

Refactor API key retrieval in Dockerfile for improved clarity and security

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -1
Dockerfile CHANGED
@@ -14,5 +14,9 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
  COPY --chown=user . /app
16
 
17
- RUN --mount=type=secret,id=APIKey,mode=0444,required=true
 
 
 
 
18
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
14
 
15
  COPY --chown=user . /app
16
 
17
+ RUN --mount=type=secret,id=APIKey,mode=0444,required=true \
18
+ API_KEY=$(cat /run/secrets/APIKey) && \
19
+ echo "API_KEY=${API_KEY}" > .env && \
20
+ chmod 600 .env
21
+
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]