Integration of PostgreSQL and pgAdmin Containers with Docker Compose
services:
postgres:
image: postgres
environment:
POSTGRES_PASSWORD: password
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: pg@ad.min
PGADMIN_DEFAULT_PASSWORD: password
ports:
- "12345:80"
Save the code above into a file named compose.yaml on your computer. Then, open your terminal, navigate to the directory containing the file, and run the command docker compose up. Wait for Docker to create and start the containers.
Once the containers are running, open your browser and go to http://localhost:12345. You will be prompted to log in to pgAdmin. In the "Email Address / Username" field, enter pg@ad.min as specified in the compose.yaml file, and in the "Password" field, enter password. Click "Login" to access the pgAdmin dashboard.
After logging in, go to the "Register Server" screen, following the steps shown in the image below.
Comentários
Postar um comentário