Traefik with postgres and pgadmin4
Note : Make sure docker is up and running .
-
Pull the docker image from dockerhub:
docker pull traefikwhich will download the latest version or if you are interested on a particular version then downlaod as shown below , for Example:docker pull traefik:v3.0 docker pull postgres docker pull dpage/pgadmin4 -
Open terminal and type
sudo nano /etc/hosts, if you are using nano or else vi or with someother editor. -
Enter
127.0.0.1traefik.testing.depgadmin.testing.depostgres.testing.deadd all the domain names by giving the space between them ) according to thetraefikwithpostgres.yaml,or
127.0.0.1 traefik.testing.de 127.0.0.1 postgres.testing.de 127.0.0.1 pgadmin.testing.dewe can change according to our request.
Note:If we want to change the domain name , change in the
traefiklatest.yamlfile and in thehostsfile. -
To save , just type ctrl+x enter Y to save ,then click on ENTER button
-
Go to the
traefikwithpostgres.yamlfile directory and then open Terminal and type :docker compose -f traefikwithpostgres.yaml up -
Open browser and type
traefik.testing.de
-
Open browser and type
pgadmin.testing.dePgadmin credentials : Username: admin@example.com Password: admin
Name: Should be service name according to Traefikwithpostgres.yaml for Example: Postgresql
Shared Username: myuser
2)Connection Settings
- Enter Ctrl+c on Terminal , all the containers will be stopped .



