# PostgreSQL connection issue with Dockerfile deployment

**URL:** <https://discuss.konghq.com/t/postgresql-connection-issue-with-dockerfile-deployment/13451>\
**Category:** Questions\
**Tags:** ai-gateway\
**Created:** [March 21, 2025, 4:58pm UTC](https://discuss.konghq.com/t/postgresql-connection-issue-with-dockerfile-deployment/13451 "2025-03-21T16:58:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/jeff/32/4871_2.png) [@jeff](https://discuss.konghq.com/u/jeff)\
**Post date:** [March 21, 2025, 4:58pm UTC](https://discuss.konghq.com/t/postgresql-connection-issue-with-dockerfile-deployment/13451/1 "2025-03-21T16:58:12Z")

</div>

I’m trying to deploy a gateway on my local machine using a Dockerfile modeled after the one in the official documentation: [Build your own Docker images - Kong Gateway - v3.9.x | Kong Docs](https://docs.konghq.com/gateway/3.9.x/install/docker/build-custom-images/)

I also deployed another container with a PostgreSQL database using the instructions on the basic docker deployment documentation (only the first 3 steps for deploying and preparing the DB): [Install Kong Gateway on Docker - v3.9.x | Kong Docs](https://docs.konghq.com/gateway/3.9.x/install/docker/)

The issue I’m having is that when I try to curl the URL, I can’t seem to get it to connect

Docker run command:  
docker run -d --name kong-gw-test --network=kong-net -e “KONG\_DATABASE=postgres” -e “KONG\_PG\_HOST=kong-database” -e “KONG\_PG\_USER=kong” -e “KONG\_PG\_PASSWORD=kongpass” -e “KONG\_PROXY\_ACCESS\_LOG=/dev/stdout” -e “KONG\_ADMIN\_ACCESS\_LOG=/dev/stdout” -e “KONG\_PROXY\_ERROR\_LOG=/dev/stderr” -e “KONG\_ADMIN\_ERROR\_LOG=/dev/stderr” -e “KONG\_ADMIN\_LISTEN=0.0.0.0:8001” -e “KONG\_ADMIN\_GUI\_URL=[http://localhost:8002](http://localhost:8002)” -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 8444:8444

Error:  
curl: (7) Failed to connect to localhost port 8001 after 0 ms: Couldn’t connect to server

---

<div class="post-metadata">

**Author:** ![rick](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/rick/32/4446_2.png) [@rick](https://discuss.konghq.com/u/rick)\
**Post date:** [March 21, 2025, 7:06pm UTC](https://discuss.konghq.com/t/postgresql-connection-issue-with-dockerfile-deployment/13451/2 "2025-03-21T19:06:34Z")

</div>

@jeff I would suggest taking a look at the logs out of docker for clues on startup failures.

```auto
docker logs <container-name/id>

```
