mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
Fix missing docker-compose (#2899)
Fix missing `docker-compose` command if only `docker compose` (note space) is available.
This commit is contained in:
parent
b634489b2e
commit
f7bf917baf
@ -1,4 +1,5 @@
|
||||
"""Script to run langchain-server locally using docker-compose."""
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
@ -6,8 +7,14 @@ from pathlib import Path
|
||||
def main() -> None:
|
||||
"""Run the langchain server locally."""
|
||||
p = Path(__file__).absolute().parent / "docker-compose.yaml"
|
||||
subprocess.run(["docker-compose", "-f", str(p), "pull"])
|
||||
subprocess.run(["docker-compose", "-f", str(p), "up"])
|
||||
|
||||
if shutil.which("docker-compose") is None:
|
||||
docker_compose_command = ["docker", "compose"]
|
||||
else:
|
||||
docker_compose_command = ["docker-compose"]
|
||||
|
||||
subprocess.run([*docker_compose_command, "-f", str(p), "pull"])
|
||||
subprocess.run([*docker_compose_command, "-f", str(p), "up"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user