GithubHelp home page GithubHelp logo

Comments (9)

WongSaang avatar WongSaang commented on June 16, 2024 1

Please refer: #27 (comment)

from chatgpt-ui.

WongSaang avatar WongSaang commented on June 16, 2024

Hello, thank you for your feedback!

Can you tell me if you have already started PostgreSQL? Or how do you plan to start your PostgreSQL server?

from chatgpt-ui.

lorenzmeis avatar lorenzmeis commented on June 16, 2024

Hello, I added this in docker-compose and the db is deploying and starting fine
db:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD:=mypassword
adminer:
image: adminer
restart: always
ports:
- 8080:8080

from chatgpt-ui.

WongSaang avatar WongSaang commented on June 16, 2024
  1. Log in to your Adminer to create a database. Let's assume your database name is "chatgpt".
  2. In the backend-wsgi-server section of the 'docker-compose.yml' file, add the environment variable: DB_URL=postgres://postgres:mypassword@db:port/chatgpt.

from chatgpt-ui.

WongSaang avatar WongSaang commented on June 16, 2024

Also, make sure that the container services are using the same network.
For example, add the network parameter

networks: 
  - chatgpt_ui_network

to your db service.

from chatgpt-ui.

lorenzmeis avatar lorenzmeis commented on June 16, 2024

Hi,
I need to start postgres without the network parameter in order to create the chatgpt database. If its created and I restart the BE, Im getting connection error in BE: (environment: DB_URL=postgres://postgres:mypassword@localhost:5432/chatgpt)
File "/usr/local/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.10/site-packages/psycopg2/init.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?

If I start DB with
networks:

  • chatgpt_ui_network
    then I can`t connect to adminer to create the chatgpt DB

from chatgpt-ui.

lorenzmeis avatar lorenzmeis commented on June 16, 2024

Perfect, now it works!
I used: environment: DB_URL=postgres://postgres:[email protected]:5432/chatgpt
and:
db:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=mypassword
- POSTGRES_DB=chatgpt
ports:
- 5432:5432

from chatgpt-ui.

lorenzmeis avatar lorenzmeis commented on June 16, 2024

I have a configuration working without using the host machine's internal IP address following the docker compose networking documentation https://docs.docker.com/compose/networking/.
1.) environment: - DB_URL=postgres://postgres:mypassword@db:5432/chatgpt
2.) Docker compose:
db:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=mypassword
- POSTGRES_DB=chatgpt
ports:
- 5432:5432
networks:
- chatgpt_ui_network

from chatgpt-ui.

WongSaang avatar WongSaang commented on June 16, 2024

👍

from chatgpt-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.