Spaces:
Running
Running
James McCool
commited on
Commit
·
faaa383
1
Parent(s):
652af3f
Enhance Dockerfile to expose MongoDB URI secret at build time and use it as a Bearer token for a curl request. Add secrets.toml file to securely store the MongoDB URI for database connection.
Browse files- {src/.streamlit → .streamlit}/secrets.toml +0 -0
- Dockerfile +4 -0
{src/.streamlit → .streamlit}/secrets.toml
RENAMED
File without changes
|
Dockerfile
CHANGED
@@ -19,6 +19,10 @@ RUN --mount=type=secret,id=mongo_uri,mode=0444,required=true \
|
|
19 |
git init && \
|
20 |
git remote add origin $(cat /run/secrets/mongo_uri)
|
21 |
|
|
|
|
|
|
|
|
|
22 |
EXPOSE 8501
|
23 |
|
24 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
|
|
19 |
git init && \
|
20 |
git remote add origin $(cat /run/secrets/mongo_uri)
|
21 |
|
22 |
+
# Expose the secret SECRET_EXAMPLE at buildtime and use its value as a Bearer token for a curl request
|
23 |
+
RUN --mount=type=secret,id=mongo_uri,mode=0444,required=true \
|
24 |
+
curl test -H 'Authorization: Bearer $(cat /run/secrets/mongo_uri)'
|
25 |
+
|
26 |
EXPOSE 8501
|
27 |
|
28 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|