-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with Docker Compose not being able to find the backend #1327
Comments
🤖 Hey there @RielKIM! 👋 I'm Dosu, your friendly neighborhood bot. I'm here to help you debug issues, answer questions, and become a super contributor to langflow. While we're waiting for a human maintainer, feel free to ask me anything. Let's make code fun! 😸 Based on the information you've provided, it seems like the frontend service is starting before the backend service is ready to accept connections. This is a common issue in Docker Compose where one service depends on another. To resolve this issue, you can add a wait-for-it script in your frontend service. This script will delay the start of the frontend service until the backend service is ready to accept connections. Here's how you can modify your docker-compose.debug.yml file: version: "3.4"
services:
backend:
volumes:
- ./:/app
build:
context: ./
dockerfile: ./dev.Dockerfile
command:
[
"sh",
"-c",
"pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -m uvicorn --factory src.backend.langflow.main:create_app --host 0.0.0.0 --port 7860 --reload",
]
ports:
- 7860:7860
- 5678:5678
restart: on-failure
frontend:
build:
context: ./src/frontend
dockerfile: ./dev.Dockerfile
args:
- BACKEND_URL=http:https://backend:7860
command: ["./wait-for-it.sh", "backend:7860", "--", "npm", "start"]
ports:
- "3000:3000"
volumes:
- ./src/frontend/public:/home/node/app/public
- ./src/frontend/src:/home/node/app/src
- ./src/frontend/package.json:/home/node/app/package.json
- ./wait-for-it.sh:/home/node/app/wait-for-it.sh
restart: on-failure In this modification, I've added a new command to the frontend service that uses the wait-for-it.sh script to wait for the backend service to be ready before starting the frontend service. I've also added a new volume to copy the wait-for-it.sh script into the frontend service's container. Please note that you'll need to add the wait-for-it.sh script to your project. You can find this script at https://github.com/vishnubob/wait-for-it. I hope this helps! If you have any other questions, feel free to ask. Best, Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
@RielKIM it's working now? |
Yes, it's working.
2024년 3월 22일 (금) 오전 12:27, anovazzi1 ***@***.***>님이 작성:
… @RielKIM <https://github.com/RielKIM> it's working now?
—
Reply to this email directly, view it on GitHub
<#1327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZ44TFQCA6KOPBSYSI6G3LYZL37NAVCNFSM6AAAAABBXLKWK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGYZTQMRQHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Describe the bug
When using Docker Compose to run services, there is often an issue where the frontend starts before the backend, leading to the frontend not being able to find the backend and thus preventing components from loading.
Browser and Version
To Reproduce
Steps to reproduce the behavior:
Screenshots
![image](https://private-user-images.githubusercontent.com/7589452/296093439-31e24be9-8cc2-40b2-baaf-b95475b6de9c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3MzI5NjksIm5iZiI6MTcyMDczMjY2OSwicGF0aCI6Ii83NTg5NDUyLzI5NjA5MzQzOS0zMWUyNGJlOS04Y2MyLTQwYjItYmFhZi1iOTU0NzViNmRlOWMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTFUMjExNzQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmFkNjhlMzVkZmU4Y2E3MDMxYmZhYzc5ODRhMzBhNmE2M2ZlMjNkNDM3OGM2ZmVkOTJjOTc2NzMxOTVmY2UxZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.DfK2MXxM4Sn2jQW2k60t3N1RHPgsZ-p1fIqGqk26rkk)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: