-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker.py
More file actions
29 lines (23 loc) · 782 Bytes
/
docker.py
File metadata and controls
29 lines (23 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import subprocess
def run(cmd):
print(f"> {cmd}")
subprocess.check_call(cmd, shell=True)
if __name__ == "__main__":
steps = [
# clean up everything stale
"docker compose down --volumes --remove-orphans",
# build and start DB
"docker compose build",
"docker compose up -d db",
# init schema + extension + table
"docker compose run --rm init-db",
# crawl docs (fills context7_docs)
"docker compose run --rm crawler",
# finally launch the app
"docker compose up -d app",
# final step: stream logs continuously
"docker compose logs -f app"
]
for cmd in steps:
run(cmd)
print("\n✅ All set! Streamlit RAG app is live at http://localhost:8501")