Update Dockerfile
Browse files- Dockerfile +2 -1
Dockerfile
CHANGED
|
@@ -53,8 +53,9 @@ RUN pip3 install --no-cache-dir --user -r requirements.txt
|
|
| 53 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 54 |
COPY --chown=user . $HOME/app
|
| 55 |
|
| 56 |
-
#
|
| 57 |
RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
|
|
|
|
| 58 |
|
| 59 |
# Make port 7860 available to the world outside this container
|
| 60 |
EXPOSE 7860
|
|
|
|
| 53 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 54 |
COPY --chown=user . $HOME/app
|
| 55 |
|
| 56 |
+
# Mount the secret and set it as an environment variable
|
| 57 |
RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
|
| 58 |
+
bash -c 'echo "export OPENAI_API_KEY=$(cat /run/secrets/OPENAI_API_KEY)" >> ~/.bashrc'
|
| 59 |
|
| 60 |
# Make port 7860 available to the world outside this container
|
| 61 |
EXPOSE 7860
|