Jacob Paris
← Back to all content

Create databases with Docker Compose

MongoDB

txt
mongo:
image: prismagraphql/mongo-single-replica:5.0.3
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: admin
expose:
- 27017
ports:
- "27017:27017"
volumes:
- ${PWD}/init.mongodb:/docker-entrypoint-initdb.d/init.mongodb:ro
- dbdata:/data/db

PostGres

txt
postgres:
image: postgres:14
ports:
- 5432:5432
restart: always
user: postgres
environment:
POSTGRES_PASSWORD: password
POSTGRES_HOST_AUTH_METHOD: password
volumes:
- ${PWD}/seed.sql:/docker-entrypoint-initdb.d/seed.sql
- dbdata:/var/lib/postgresql/data
Professional headshot
Moulton
Moulton

Hey there! I'm a developer, designer, and digital nomad building cool things with Remix, and I'm also writing Moulton, the Remix Community Newsletter

About once per month, I send an email with:

  • New guides and tutorials
  • Upcoming talks, meetups, and events
  • Cool new libraries and packages
  • What's new in the latest versions of Remix

Stay up to date with everything in the Remix community by entering your email below.

Unsubscribe at any time.