Ibraaheem commited on
Commit
8cc31ac
·
1 Parent(s): 4ad11ce

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -3
Dockerfile CHANGED
@@ -40,10 +40,13 @@ COPY --chown=worker *.yaml *.md ./
40
 
41
  USER worker
42
 
43
- # Expose the secret SECRET_EXAMPLE at buildtime and use its value as git remote URL
44
  RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
45
- git init && \
46
- git remote add origin $(cat /run/secrets/OPENAI_API_KEY)
 
 
 
47
 
48
  # Activate the virtual environment and run uvicorn
49
  CMD [".venv/bin/python", "-m", "uvicorn", "private_gpt.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
40
 
41
  USER worker
42
 
43
+ # Get secret EXAMPLE and output it to /test at buildtime
44
  RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
45
+ cat /run/secrets/OPENAI_API_KEY > /test
46
+
47
+ # Get secret SECRET_EXAMPLE and clone it as repo at buildtime
48
+ RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
49
+ git clone $(cat /run/secrets/OPENAI_API_KEY)
50
 
51
  # Activate the virtual environment and run uvicorn
52
  CMD [".venv/bin/python", "-m", "uvicorn", "private_gpt.main:app", "--host", "0.0.0.0", "--port", "7860"]