version: '3'
services:
  my-app:
    # build: .
    image: docker-hub-user/image-name:image-tag
    ports:
     - 3000:3000
    environment:
     - MONGO_DB_USERNAME=${MONGO_ADMIN_USER}
     - MONGO_DB_PWD=${MONGO_ADMIN_PASS}
  mongodb:
    image: mongo
    ports:
     - 27017:27017
    environment:
     - MONGO_INITDB_ROOT_USERNAME=${MONGO_ADMIN_USER}
     - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ADMIN_PASS}
  mongo-express:
    image: mongo-express
    restart: always
    ports:
     - 8081:8081
    environment:
     - ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGO_ADMIN_USER}
     - ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGO_ADMIN_PASS}
     - ME_CONFIG_MONGODB_SERVER=mongodb
    depends_on:
     - "mongodb"