Skip to content

Instantly share code, notes, and snippets.

@rudyj03
Last active November 14, 2019 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudyj03/04a0d3842dfe1def3743404ba118b01f to your computer and use it in GitHub Desktop.
Save rudyj03/04a0d3842dfe1def3743404ba118b01f to your computer and use it in GitHub Desktop.
This docker compose file creates an empty Postgres database container and a pgAdmin container. You can connect to the database by specifying "database" as the host name in the pgAdmin UI along with the Postgres credentials listed in this compose file.
version: '3.1'
services:
postgresql:
image: postgres:11-alpine
container_name: database
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test
POSTGRES_DB: postgres
ports:
- "5432:5432"
volumes:
- ./postgres-data:/var/lib/postgresql/data
networks:
- db-net
pgadmin4:
image: dpage/pgadmin4:4.14
container_name: pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@root.com
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
- ./pgadmin-data:/var/lib/pgadmin
ports:
- 80:80
networks:
- db-net
networks:
db-net:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment