フラスコアプリとPostgresイメージが同じDockerコンテナーにないため、ローカルホスト経由でデータベースにアクセスすることはできません!!
データベースのURLでlocalhostを置き換えます docker-compose /
のPostgresサービスの名前engine = create_engine('postgresql://user:example@sqldat.com{}:5432/database'.format('service_name_of_postgres'))
フラスコアプリとPostgresイメージが同じDockerコンテナーにないため、ローカルホスト経由でデータベースにアクセスすることはできません!!
データベースのURLでlocalhostを置き換えます docker-compose /
のPostgresサービスの名前engine = create_engine('postgresql://user:example@sqldat.com{}:5432/database'.format('service_name_of_postgres'))