jj9987 Posted September 4 Author Share Posted September 4 1 hour ago, Braulio Dias Ribeiro said: How can I connect postgres to another docker? What do I need to type in the PATH? If both containers (the application and postgresql) are in the same custom network, you can connect using postgresql container's (host)name. If you are using host networking, you will need to use the host IP. Quote Link to comment
Braulio Dias Ribeiro Posted September 5 Share Posted September 5 14 hours ago, jj9987 said: If both containers (the application and postgresql) are in the same custom network, you can connect using postgresql container's (host)name. If you are using host networking, you will need to use the host IP. They are on the same network. But I don't know how to set username and password. Is that it? postgresql://USER:PASSWORD@Postgres:5432/langflow Quote Link to comment
jj9987 Posted September 6 Author Share Posted September 6 (edited) On 9/5/2024 at 9:59 AM, Braulio Dias Ribeiro said: They are on the same network. But I don't know how to set username and password. Is that it? postgresql://USER:PASSWORD@Postgres:5432/langflow If you are using the official PostgreSQL image, then you can configure the initial superuser using POSTGRES_USER and POSTGRES_PASSWORD environment variables for username/password and POSTGRES_DB for database name. For simplicity purposes, you can use these. But it is recommended to connect with the superuser to the database and create a custom user and database for the application. You can follow PostgreSQL documentation for that, but the basics should be: CREATE USER 'user' WITH ENCRYPTED PASSWORD 'password'; CREATE DATABASE 'database' WITH OWNER 'user'; Edited September 6 by jj9987 Quote Link to comment
Braulio Dias Ribeiro Posted September 6 Share Posted September 6 38 minutes ago, jj9987 said: If you are using the official PostgreSQL image, then you can configure the initial superuser using POSTGRES_USER and POSTGRES_PASSWORD environment variables for username/password and POSTGRES_DB for database name. For simplicity purposes, you can use these. But it is recommended to connect with the superuser to the database and create a custom user and database for the application. You can follow PostgreSQL documentation for that, but the basics should be: CREATE USER 'user' WITH ENCRYPTED PASSWORD 'password'; CREATE DATABASE 'database' WITH OWNER 'user'; I wanted to know how to fill in this path, if this was right. I found the answer, here's the solution. LANGFLOW_DATABASE_URL = postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME} In my case postgresql://langflow:PASSWORD@Postgres:5432/langflow Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.