Docker DataBases


PostgreSQL

version: '3'
services:
  db:
    image: postgres
    restart: always
    ports:
      - '5432:5432'
    environment:
      POSTGRES_PASSWORD: pass123


.env

DATABASE_HOST=localhost
DATABASE_NAME=postgres
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASSWORD=pass123
SECRET_KEY=1HyftmH8tPzutU46s2MXM87QuF844WKm


Example:
https://github.com/webmakaka/Uber-Eats-Clone



Run pgadmin in docker container:

$ docker run -e PGADMIN_DEFAULT_EMAIL='[email protected]' -e PGADMIN_DEFAULT_PASSWORD='password1234' -p 5555:80 --name pgadmin dpage/pgadmin4


http://localhost:5555/

login: [email protected]
pass: password1234


MongoDB

version: '3'
services:
  db:
    image: mongo
    restart: always
    ports:
      - '27017:27017'
    environment:
      MONGODB_DATABASE: mongo-database


Example: https://github.com/webmakaka/NestJS-Fundamentals-Course/


docker-db-templates

https://github.com/dalisoft/dev-env/tree/master/packages/docker-db-templates