Robaa commited on
Commit
652c2cf
·
1 Parent(s): 68f9e47

Improve API key retrieval logic in Dockerfile for better handling of existing remote

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -2
Dockerfile CHANGED
@@ -15,7 +15,7 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
15
  COPY --chown=user . /app
16
 
17
  RUN --mount=type=secret,id=APIKey,mode=0444,required=true \
18
- git init && \
19
- git remote add origin $(cat /run/secrets/APIKey)
20
 
21
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
15
  COPY --chown=user . /app
16
 
17
  RUN --mount=type=secret,id=APIKey,mode=0444,required=true \
18
+ git init && \
19
+ (git remote get-url origin || git remote add origin $(cat /run/secrets/APIKey))
20
 
21
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]