Last active
December 24, 2024 10:43
-
-
Save pseudo-usama/e995977eb16e48d3fff21e9c26841078 to your computer and use it in GitHub Desktop.
Compose file to set up PostgreSQL and pgAdmin using Docker. Includes a PostgreSQL database with custom user credentials and a pgAdmin web interface for management, connected via a custom network.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker compose up -d | |
sudo docker compose down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker-compose.yml | |
version: '3.8' | |
services: | |
postgres: | |
image: postgres:latest | |
container_name: postgres | |
environment: | |
POSTGRES_USER: pguser | |
POSTGRES_PASSWORD: root | |
POSTGRES_DB: mydatabase | |
ports: | |
- "5432:5432" | |
networks: | |
- pg-network | |
pgadmin: | |
image: dpage/pgadmin4:latest | |
container_name: pgadmin | |
environment: | |
PGADMIN_DEFAULT_EMAIL: [email protected] | |
PGADMIN_DEFAULT_PASSWORD: admin | |
ports: | |
- "8080:80" | |
networks: | |
- pg-network | |
networks: | |
pg-network: | |
driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment