version: "3.9"

services:
  ferretdb:
    # ./ferretdb-linux-amd64 --sqlite-url="file:data/"
    #image: ghcr.io/ferretdb/ferretdb:1.23.0 # has bugs, because they use no root
    image: ghcr.io/ferretdb/ferretdb:1.21.0
    #image: ghcr.io/ferretdb/all-in-one:1.23.0
    network_mode: "host"        
    environment:
      - FERRETDB_HANDLER=sqlite
      - FERRETDB_SQLITE_URL=file:/data/
      - FERRETDB_DEBUG_ADDR=127.0.0.1:21239
    volumes:
      - ./configs/ferretdb_data:/data/
    restart: always

  #my_mongo:
  #  image: mongo:6.0.4-jammy
  #  network_mode: "host"        
  #  # expose:
  #  #   - "27017:27017"
  #  # ports:
  #  #   - '27017:27017'
  #  environment:
  #    - MONGO_INITDB_ROOT_USERNAME=yingshaoxo
  #    - MONGO_INITDB_ROOT_PASSWORD=yingshaoxo
  #  volumes:
  #    - "./configs/mongodb_data:/data/db"
  #  restart: always

  # 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: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:5432"
  #   # ports:
  #   #   - '5432:5432'
  #   volumes: 
  #     - ./configs/postgre_sql_db:/var/lib/postgresql/data
