version: '3.1'

services:
  database:
    image: mongo:latest
    environment:
      - MONGO_INITDB_ROOT_USERNAME=<%= name %>user
      - MONGO_INITDB_ROOT_PASSWORD=<%= name %>password
    ports:
      - 27017:27017
    restart: always

  mongo-express:
    image: mongo-express
    restart: always
    ports:
      - 8081:8081
    environment:
      - ME_CONFIG_MONGODB_ADMINUSERNAME=<%= name %>user
      - ME_CONFIG_MONGODB_ADMINPASSWORD=<%= name %>password
      - ME_CONFIG_MONGODB_URL=mongodb://<%= name %>user:<%= name %>password@database:27017/

<% if (useCacheRedis) { %>
  redis:
    image: redis:latest
    ports:
      - 63791:6379
<% } %>
