Skip to content

Instantly share code, notes, and snippets.

@klovack
Created December 12, 2019 18:31
Show Gist options
  • Save klovack/55dc01f16f20e88633c12f69227ed30b to your computer and use it in GitHub Desktop.
Save klovack/55dc01f16f20e88633c12f69227ed30b to your computer and use it in GitHub Desktop.
Docker compose file for launching postgres with pgadmin4
version: "3.7"
services:
postgres:
image: postgres:latest
ports:
- "5432:5432"
networks:
- pg-network
volumes:
- "pgvolume:/"
- "$HOME/.postgres-data:/"
environment:
- PG_MODE: primary
- PG_PRIMARY_USER: postgres
- PG_PRIMARY_PASSWORD: my-secret-password
- PG_DATABASE: demo
- PG_ROOT_PASSWORD: my-secret-password
- PG_PRIMARY_PORT: 5432
pgadmin4:
image: dpage/pgadmin4
ports:
- "5050:80"
- "5443:443"
networks:
- pg-network
volumes:
- "pga4volume:/var/lib/pgadmin
- "$HOME/.pgadmin:/"
environment:
- PGADMIN_DEFAULT_EMAIL: your-email@example.com
- PGADMIN_DEFAULT_PASSWORD: your-secret-password
- SERVER_PORT: 5050
volumes:
pgvolume:
pga4volume:
networks:
pg-network:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment