version: "3.9"

services:
  # dragonfly: # the new redis
  #   image: docker.dragonflydb.io/dragonflydb/dragonfly:v0.12.0
  #   command:
  #     - "--save_schedule=*:05" # save for every 1 minute
  #     - "--dbfilename=/data/dump.rdb"
  #   expose:
  #     - "6379:6379"
  #   # ports:
  #   #   - '6379:6379'
  #   volumes:
  #     - "./configs/redis_data:/data"
  #   restart: unless-stopped

  redis: 
    image: redis:7.0
    command: bash -c "redis-server --save 60 1" # save for every 1 minute if at least one operation has been made
    expose:
      - "6379"
    # ports:
    #   - '6379:6379'
    volumes:
      - "./configs/redis_data:/data"
    restart: unless-stopped
 
  db:
    image: postgres:15
    restart: always
    environment:
      - POSTGRES_USER=yingshaoxo
      - POSTGRES_PASSWORD=yingshaoxo
    expose:
      - "5432"
    # ports:
    #   - '5432:5432'
    volumes: 
      - ./configs/postgre_sql_db:/var/lib/postgresql/data

  my_mongo:
    image: mongo:6.0.4-jammy
    restart: always
    expose:
      - "27017"
    # ports:
    #   - '27017:27017'
    environment:
      - MONGO_INITDB_ROOT_USERNAME=yingshaoxo
      - MONGO_INITDB_ROOT_PASSWORD=yingshaoxo

  # #http://127.0.0.1:8081/db/friend_list
  # mongo-express:
  #   image: mongo-express
  #   restart: always
  #   # expose:
  #   #   - "8081"
  #   ports:
  #     - 8081:8081
  #   environment:
  #     - ME_CONFIG_MONGODB_ADMINUSERNAME=yingshaoxo
  #     - ME_CONFIG_MONGODB_ADMINPASSWORD=yingshaoxo
  #     - ME_CONFIG_MONGODB_URL=mongodb://yingshaoxo:yingshaoxo@my_mongo:27017/

  