version: '3.1'

services:
  mongo:
    container_name: mongo-dev
    image: mongo:4.2.10
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USER}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD}
    ports:
      - 27017:27017
    volumes:
      - ${DATA_HOME}:/data/db
  mongo-express:
    container_name: mongo-express-dev
    image: mongo-express
    restart: always
    ports:
      - 8181:8081
    environment:
      ME_CONFIG_MONGODB_SERVER: 'mongo'
      ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGODB_USER}
      ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGODB_PASSWORD}

  redis:
    container_name: redis-dev
    image: redis:6.0.8
    restart: always
    ports:
      - 6379:6379
    command: >
      --requirepass ${REDIS_PASSWORD}
    volumes:
      - ${DATA_HOME}:/data
