• superpants@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago

    The python container should connect on postgres:5432 not localhost. To the web container, localhost is itself, not the physical host running docker

    • sunwoo1524@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 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