Skip to content

Instantly share code, notes, and snippets.

@bit4bit
Created February 18, 2023 20: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 bit4bit/a5d6bb408e7d724c252ec234c7ed3583 to your computer and use it in GitHub Desktop.
Save bit4bit/a5d6bb408e7d724c252ec234c7ed3583 to your computer and use it in GitHub Desktop.
opiniated docker-compose for the Art of PostgreSQL
# an opiniated docker-compose for the Art of PostgreSQL
# copy this file to docker-compose.yml and then:
# 1. copy extra resources to the same file
# 2. `docker-compose up`
# 3. open http://localhost:9088 with username admin@learn.dev and password admin
# 4. add connection to database db.dev using host `db.dev` database name `book` username `book` password `book`
# 5. `docker-compose down`
version: '3.7'
services:
db.dev:
image: postgres:12
environment:
POSTGRES_PASSWORD: book
POSTGRES_DB: book
POSTGRES_USER: book
working_dir: /app
volumes:
- db:/var/lib/postgresql/data
- .:/app
pgadmin.dev:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_PASSWORD: admin
PGADMIN_DEFAULT_EMAIL: admin@learn.dev
ports:
- 9088:80
volumes:
- pgadmin:/var/lib/pgadmin
volumes:
db:
pgadmin:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment