1414import docker
1515from dotenv import load_dotenv
1616
17+ # client = docker.from_env()
1718load_dotenv ()
1819
1920container_registry = os .getenv ("AZURE_CONTAINER_REGISTRY" )
2526
2627if sys .platform == "darwin" :
2728 print ("Running on Mac" )
29+ print (f"container_registry: { container_registry } " )
30+ print (f"repo: { repo } " )
2831 client = docker .DockerClient (
29- base_url = "unix:///Users/matthewharris/.docker/run/docker.sock "
32+ # base_url="unix:///Users/matthewharris/.docker/run/docker.sock "
33+ base_url = "unix:///Users/t.o./.docker/run/docker.sock "
3034 )
3135else :
3236 client = docker .from_env ()
@@ -72,8 +76,8 @@ def deploy():
7276 sys .exit ()
7377
7478 tags = {
75- "data-recipes-ai-server" : [f"{ container_registry } /{ repo } " , "server" ],
76- "data-recipes-ai-chat" : [f"{ container_registry } /{ repo } " , "chat" ],
79+ "data-recipes-ai-server:latest " : [f"{ container_registry } /{ repo } " , "server" ],
80+ "data-recipes-ai-chat:latest " : [f"{ container_registry } /{ repo } " , "chat" ],
7781 }
7882
7983 run_cmd ("az login" )
@@ -87,13 +91,15 @@ def deploy():
8791 f"DOCKER_DEFAULT_PLATFORM={ azure_platform } && docker compose -f { docker_compose_file } build"
8892 )
8993
94+ # run_cmd("docker compose build")
95+
9096 for image in tags .keys ():
9197 print (f"Tagging { image } image ... with tag { tags [image ][0 ]} :{ tags [image ][1 ]} " )
9298 client .images .get (image ).tag (tags [image ][0 ], tags [image ][1 ])
9399 print (f"Pushing { image } image ... to { tags [image ][0 ]} :{ tags [image ][1 ]} " )
94100 client .images .push (tags [image ][0 ], tags [image ][1 ])
95101
96- sys .exit ()
102+ # sys.exit()
97103
98104 run_cmd (f"docker compose -f { docker_compose_file } down" )
99105 run_cmd (f"docker compose -f { docker_compose_file } pull" )
0 commit comments