Published (Exposed) Ports in Docker

  • 16 April 2021
  • 1 reply
  • 72 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.

 


1 reply

Userlevel 2

If you have another application running on port 3000, you may also change the port where GoodData.CN Community Edition will be running.

For example, if you want to use port 3333 instead, add the following parameters to your docker run command:

-p 3333:3000 -e EXTERNAL_PORT=3333

The environment variable EXTERNAL_PORT will customize other internal settings necessary for the proper operation of the container.

Reply