Published (Exposed) Ports in Docker

  • 16 April 2021
  • 0 replies
  • 16 views

Userlevel 2

When you run a Docker container, no Docker ports are accessible by outside services. To override this default behavior, you need to use the -p flag that binds a container port to a port on the Docker host. The syntax is -p hostPort:containerPort.

Running GoodData.CN Community Edition with -p 3000:3000 allows you to access GoodData at http://localhost:3000.

The Community Edition is bundled with an instance of PostgreSQL, running internally on port 5432. Running the container with -p 5432:5432 allows you to access the database from your favorite SQL client. The database is called demo and you can access it at postgresql://localhost:5432/demo with the username demouser and password demopass. See documentation for details about the demo database.  

Configuration example from DBeaver

Tip

Do you already have your own PostgreSQL database running on localhost:5432? Run the Docker container with -p 5433:5432. The demo database will still run in Docker on port 5432 and you can access it outside the container on port 5433.

 


0 replies

Be the first to reply!

Reply