假设第二个 docker 实例的命令是
docker run --rm --net=host -p 3002:3002 -e SERVER_PORT="3002" \
-e PGRST_DB_URI="postgres://postgres@localhost/prod2" \
-e PGRST_DB_ANON_ROLE="postgres" postgrest/postgrest
结果
WARNING: Published ports are discarded when using host network mode
Attempting to connect to the database...
Listening on port 3000
postgrest: Network.Socket.bind: resource busy (Address already in use)
这没有任何意义,因为使用-p 3002:3002 -e SERVER_PORT="3002"
... 是否可以运行?配置错误在哪里?
注意:第一个 docker 是由docker run -d --net=host -p 3000:3000 -e PGRST_DB_URI="postgres://postgres@localhost/prod0" -e PGRST_DB_ANON_ROLE="postgres" postgrest/postgrest