Database organisation with docker

docker databases

To avoid version conflicts and to not mess up my computer by accident, I have my own simple way of organizing databases. I dockerize them! There’s no reason not to do this when developing at home, because:

  1. it’s easy to do(easier than the traditional way)
  2. you can avoid messing with your computer(especially on windows)
  3. multiple database versions on the same machine

I first thought of this solution after trying(and failing) to install MySQL on windows. I wish I could switch to Linux in times like these.

# docker-compose.yaml
version: '3'
services:
  redis:
    image: redis
    ports:
      - '6379:6379'
  mysql:
    image: mysql
    ports:
      - '3307:3306'
    environment:
      MYSQL_ROOT_PASSWORD: 'root'
  mongodb:
    image: mongo
    ports:
      - '27017:27017'
  neo4j:
    image: neo4j
    ports:
      - '7474:7474'
      - '7687:7687'
    environment:
      NEO4J_AUTH: 'neo4j/root'