记录一些常用的docker-composer.yml配置文件

  1. mongo
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    version: '3'
    services:
    mongodb:
    image: mongo
    container_name: mongo_test
    environment:
    - MONGO_INITDB_ROOT_USERNAME=admin
    - MONGO_INITDB_ROOT_PASSWORD=admin
    volumes:
    - /home/sun/mongotest/db:/data/db
    - /home/sun/mongotest/log:/var/log/mongodb
    ports:
    - 27017:27017
    restart: always