Created
December 17, 2018 20:00
-
-
Save vegarringdal/f353ab712b3d09e07747eb0e4dad0f39 to your computer and use it in GitHub Desktop.
postgres docker and pgadmin
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
| version: '3.5' | |
| # docker with pgadmin/postgres/nodejs | |
| # endable docker to start with OS | |
| # - sudo systemctl enable docker | |
| # to run: | |
| # sudo docker-compose up -d | |
| # remove the -d to get messages from docker, do not run in vscode | |
| # todo add redis memory db for users etc | |
| services: | |
| postgres: | |
| container_name: postgres_container | |
| image: postgres:11.1 | |
| environment: | |
| POSTGRES_USER: ${POSTGRES_USER:-postgres} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} | |
| POSTGRES_DB: ${POSTGRES_DB:-postgres} | |
| PGDATA: /data/postgres | |
| volumes: | |
| - ./postgres:/data/postgres | |
| ports: | |
| - "${POSTGRES_PORT:-5432}:5432" | |
| expose: | |
| - "5432" | |
| networks: | |
| - ${POSTGRES_HOST:-postgres} | |
| restart: always | |
| pgadmin: | |
| container_name: pgadmin_container | |
| image: dpage/pgadmin4 | |
| environment: | |
| PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]} | |
| PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-postgres} | |
| volumes: | |
| - ./pgadmin:/var/lib/pgadmin/storage | |
| ports: | |
| - "${PGADMIN_PORT:-5050}:80" | |
| networks: | |
| - postgres | |
| restart: always | |
| networks: | |
| postgres: | |
| driver: bridge | |
| volumes: | |
| postgres: | |
| pgadmin: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment