Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mpog-helper-openai
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anes_AI
mpog-helper-openai
Commits
b1ea2a79
Commit
b1ea2a79
authored
2 years ago
by
Ryan Melvin
Browse files
Options
Downloads
Patches
Plain Diff
docker secerets for openai api
parent
3a4cf467
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app.py
+16
-0
16 additions, 0 deletions
app.py
docker-compose.yml
+0
-12
0 additions, 12 deletions
docker-compose.yml
with
16 additions
and
12 deletions
app.py
+
16
−
0
View file @
b1ea2a79
...
@@ -9,6 +9,22 @@ from langchain.prompts import (
...
@@ -9,6 +9,22 @@ from langchain.prompts import (
SystemMessagePromptTemplate
,
SystemMessagePromptTemplate
,
HumanMessagePromptTemplate
,
HumanMessagePromptTemplate
,
)
)
import
os
def
manage_sensitive
(
name
):
secret_fpath
=
f
'
/run/secrets/
{
name
}
'
existence
=
os
.
path
.
exists
(
secret_fpath
)
if
existence
:
v2
=
open
(
secret_fpath
).
read
().
rstrip
(
'
\n
'
)
return
v2
if
not
existence
:
return
KeyError
(
f
'
{
name
}
'
)
OPENAI_API_KEY
=
manage_sensitive
(
"
openai_api_key
"
)
os
.
environ
[
"
OPENAI_API_KEY
"
]
=
OPENAI_API_KEY
st
.
set_page_config
(
st
.
set_page_config
(
page_title
=
"
MPOG Helper
"
,
page_title
=
"
MPOG Helper
"
,
page_icon
=
"
🤖
"
,
page_icon
=
"
🤖
"
,
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
0
−
12
View file @
b1ea2a79
...
@@ -10,19 +10,7 @@ services:
...
@@ -10,19 +10,7 @@ services:
environment
:
environment
:
-
PYTHONUNBUFFERED=1
-
PYTHONUNBUFFERED=1
secrets
:
secrets
:
-
db_server
-
db_name
-
db_user
-
db_password
-
openai_api_key
-
openai_api_key
secrets
:
secrets
:
db_server
:
file
:
secrets/db_server.txt
db_name
:
file
:
secrets/db_name.txt
db_user
:
file
:
secrets/db_user.txt
db_password
:
file
:
secrets/db_password.txt
openai_api_key
:
openai_api_key
:
file
:
secrets/openai_api_key.txt
file
:
secrets/openai_api_key.txt
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment