Spaces:
Runtime error
Runtime error
updated docker compose
Browse files- docker-compose.yml +6 -24
docker-compose.yml
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
version: "3.8"
|
2 |
|
3 |
services:
|
4 |
-
# Step 1: Run Deployment
|
5 |
deployment:
|
6 |
build:
|
7 |
context: .
|
@@ -14,58 +13,41 @@ services:
|
|
14 |
zenml model-deployer register mlflow_customer_churn_new --flavor=mlflow &&
|
15 |
zenml stack register mlflow_stack_customer_churn_new -a default -o default -d mlflow -e mlflow_tracker_customer_churn_new --set &&
|
16 |
zenml stack set mlflow_stack_customer_churn_new &&
|
17 |
-
python3 run_pipeline.py&&
|
18 |
python3 run_deployment.py
|
19 |
"
|
20 |
volumes:
|
21 |
- .:/app
|
22 |
working_dir: /app
|
23 |
restart: on-failure
|
24 |
-
healthcheck:
|
25 |
-
test: ["CMD", "curl", "-f", "http://localhost:8000/health"] # Adjust URL for deployment health check
|
26 |
-
interval: 10s
|
27 |
-
retries: 3
|
28 |
-
start_period: 5s
|
29 |
-
timeout: 5s
|
30 |
|
31 |
-
# Step 2: Run FastAPI service after Deployment is completed
|
32 |
fastapi_service:
|
33 |
build:
|
34 |
context: .
|
35 |
dockerfile: Dockerfile
|
36 |
command: ["uvicorn", "backend.fastapi_app:app", "--host", "0.0.0.0", "--port", "8001"]
|
37 |
depends_on:
|
38 |
-
|
|
|
39 |
volumes:
|
40 |
- .:/app
|
41 |
working_dir: /app
|
42 |
ports:
|
43 |
- "8001:8001"
|
44 |
restart: on-failure
|
45 |
-
healthcheck:
|
46 |
-
test: ["CMD", "curl", "-f", "http://localhost:8001/health"] # Adjust URL for FastAPI health check
|
47 |
-
interval: 10s
|
48 |
-
retries: 3
|
49 |
-
start_period: 5s
|
50 |
-
timeout: 5s
|
51 |
|
52 |
-
# Step 3: Run Streamlit UI after FastAPI service is up
|
53 |
streamlit:
|
54 |
build:
|
55 |
context: .
|
56 |
dockerfile: Dockerfile
|
57 |
command: ["streamlit", "run", "frontend/main.py"]
|
58 |
depends_on:
|
59 |
-
|
|
|
60 |
volumes:
|
61 |
- .:/app
|
62 |
working_dir: /app
|
63 |
ports:
|
64 |
- "8501:8501"
|
65 |
restart: on-failure
|
66 |
-
|
67 |
-
test: ["CMD", "curl", "-f", "http://localhost:8501/health"] # Adjust URL for Streamlit health check
|
68 |
-
interval: 10s
|
69 |
-
retries: 3
|
70 |
-
start_period: 5s
|
71 |
-
timeout: 5s
|
|
|
1 |
version: "3.8"
|
2 |
|
3 |
services:
|
|
|
4 |
deployment:
|
5 |
build:
|
6 |
context: .
|
|
|
13 |
zenml model-deployer register mlflow_customer_churn_new --flavor=mlflow &&
|
14 |
zenml stack register mlflow_stack_customer_churn_new -a default -o default -d mlflow -e mlflow_tracker_customer_churn_new --set &&
|
15 |
zenml stack set mlflow_stack_customer_churn_new &&
|
16 |
+
python3 run_pipeline.py &&
|
17 |
python3 run_deployment.py
|
18 |
"
|
19 |
volumes:
|
20 |
- .:/app
|
21 |
working_dir: /app
|
22 |
restart: on-failure
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
|
|
24 |
fastapi_service:
|
25 |
build:
|
26 |
context: .
|
27 |
dockerfile: Dockerfile
|
28 |
command: ["uvicorn", "backend.fastapi_app:app", "--host", "0.0.0.0", "--port", "8001"]
|
29 |
depends_on:
|
30 |
+
deployment:
|
31 |
+
condition: service_healthy
|
32 |
volumes:
|
33 |
- .:/app
|
34 |
working_dir: /app
|
35 |
ports:
|
36 |
- "8001:8001"
|
37 |
restart: on-failure
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
|
|
39 |
streamlit:
|
40 |
build:
|
41 |
context: .
|
42 |
dockerfile: Dockerfile
|
43 |
command: ["streamlit", "run", "frontend/main.py"]
|
44 |
depends_on:
|
45 |
+
fastapi_service:
|
46 |
+
condition: service_healthy
|
47 |
volumes:
|
48 |
- .:/app
|
49 |
working_dir: /app
|
50 |
ports:
|
51 |
- "8501:8501"
|
52 |
restart: on-failure
|
53 |
+
|
|
|
|
|
|
|
|
|
|