• @sunwoo1524OP
    link
    English
    111 months ago

    I changed host to postgres:5432, but python made an error.

    sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "postgres" to address: Temporary failure in name resolution
    
    • @superpants
      link
      English
      211 months ago

      Sorry, I misread your compose file. It should be the name of the PG container, so db:5432

      • @sunwoo1524OP
        link
        English
        111 months ago

        Thanks!
        I also added

        depends_on:
              - db
        

        to docker-compose.yaml and fixed the issue!