-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Error Docker Compose #3546
Comments
Hello, @alvarolucasno! I'm here to assist you with bugs, questions, and becoming a contributor. Let's squash those bugs together! 🤖 To resolve the "ModuleNotFoundError: No module named 'psycopg2'" error when deploying the stack in Docker Compose, you need to ensure that the You can do this by modifying the Dockerfile for the # Use the official Python image from the Docker Hub
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt .
# Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Install psycopg2
RUN pip install psycopg2-binary
# Copy the rest of the application code into the container
COPY . .
# Command to run the application
CMD ["python", "app.py"] Make sure your After modifying the Dockerfile, you need to rebuild the Docker image and redeploy the stack: docker-compose build langflow
docker-compose up -d This will ensure that the |
In this case, I have to rebuild the image. If it's possible to add this step to the image available on DOCKER HUB, it would make things simpler. Anyway, thank you! |
Hi, @alvarolucasno . I hope you're doing well. |
Bug Description
When deploying the stack in Portainer, I received the following error.
Reproduction
Stack:
version: "3.8"
services:
langflow:
image: langflowai/langflow:latest
ports:
- "7860:7860"
depends_on:
- postgres
environment:
- LANGFLOW_DATABASE_URL=postgresql://langflow:langflow@postgres:5432/langflow
volumes:
- langflow-data:/app/langflow
postgres:
image: postgres:16
environment:
POSTGRES_USER: langflow
POSTGRES_PASSWORD: langflow
POSTGRES_DB: langflow
ports:
- "5432:5432"
volumes:
- langflow-postgres:/var/lib/postgresql/data
volumes:
langflow-postgres:
langflow-data:
Erro:
[08/26/24 10:57:08] ERROR 2024-08-26 10:57:08 - ERROR - init.py:1762
init - Worker (pid:19) exited
with code 3
ERROR 2024-08-26 10:57:08 - ERROR - init.py:1762
init - Shutting down: Master
ERROR 2024-08-26 10:57:08 - ERROR - init.py:1762
init - Reason: Worker failed
to boot.
Expected behavior
Service execution and application start.
Who can help?
@italojohnny
Operating System
Docker Swarm
Langflow Version
latest
Python Version
None
Screenshot
No response
Flow File
No response
The text was updated successfully, but these errors were encountered: