Ibraaheem commited on
Commit
3ad6797
·
1 Parent(s): b557d41

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -0
Dockerfile CHANGED
@@ -9,6 +9,15 @@ ENV PATH="/root/.local/bin:$PATH"
9
  # https://python-poetry.org/docs/configuration/#virtualenvsin-project
10
  ENV POETRY_VIRTUALENVS_IN_PROJECT=true
11
 
 
 
 
 
 
 
 
 
 
12
  FROM base as dependencies
13
  WORKDIR /home/worker/app
14
  COPY pyproject.toml poetry.lock ./
 
9
  # https://python-poetry.org/docs/configuration/#virtualenvsin-project
10
  ENV POETRY_VIRTUALENVS_IN_PROJECT=true
11
 
12
+ # Expose the secret SECRET_EXAMPLE at buildtime and use its value as git remote URL
13
+ RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
14
+ git init && \
15
+ git remote add origin $(cat /run/secrets/SECRET_EXAMPLE)
16
+
17
+ # Expose the secret SECRET_EXAMPLE at buildtime and use its value as a Bearer token for a curl request
18
+ RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
19
+ curl test -H 'Authorization: Bearer $(cat /run/secrets/OPENAI_API_KEY)'
20
+
21
  FROM base as dependencies
22
  WORKDIR /home/worker/app
23
  COPY pyproject.toml poetry.lock ./