version: '3' services: growi: build: context: . dockerfile: ./Dockerfile ports: - 127.0.0.1:3000:3000 # localhost only by default links: - mongo:mongo - elasticsearch:elasticsearch depends_on: - mongo - elasticsearch environment: - MONGO_URI=mongodb://mongo:27017/growi - ELASTICSEARCH_URI=http://elasticsearch:9200/growi - PASSWORD_SEED=changeme # - FILE_UPLOAD=mongodb # activate this line if you use MongoDB GridFS rather than AWS # - FILE_UPLOAD=local # activate this line if you use local storage of server rather than AWS # - MATHJAX=1 # activate this line if you want to use MathJax # - PLANTUML_URI=http:// # activate this line and specify if you use your own PlantUML server rather than public plantuml.com # - HACKMD_URI=http:// # activate this line and specify HackMD server URI which can be accessed from GROWI client browsers # - HACKMD_URI_FOR_SERVER=http://hackmd:3000 # activate this line and specify HackMD server URI which can be accessed from this server container # - FORCE_WIKI_MODE='public' # activate this line to force wiki public mode # - FORCE_WIKI_MODE='private' # activate this line to force wiki private mode entrypoint: "dockerize -wait tcp://mongo:27017 -wait tcp://elasticsearch:9200 -timeout 60s /docker-entrypoint.sh" command: ["yarn migrate && node -r dotenv-flow/config --expose_gc dist/server/app.js"] restart: unless-stopped volumes: - growi_data:/data networks: - dmz - trust mongo: image: mongo:6.0 restart: unless-stopped volumes: - mongo_configdb:/data/configdb - mongo_db:/data/db networks: - trust elasticsearch: build: context: ./elasticsearch/v8 dockerfile: ./Dockerfile environment: - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms256m -Xmx256m" # increase amount if you have enough memory - LOG4J_FORMAT_MSG_NO_LOOKUPS=true # CVE-2021-44228 mitigation for Elasticsearch <= 6.8.20/7.16.0 ulimits: memlock: soft: -1 hard: -1 restart: unless-stopped volumes: - es_data:/usr/share/elasticsearch/data - ./elasticsearch/v8/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml networks: - trust volumes: growi_data: mongo_configdb: mongo_db: es_data: networks: dmz: external: true trust:

起動

$ docker compose up -d
  • OS 起動時にも自動的に起動される
  • docker compose down で停止。 restart が unless-stopped 指定なので、docker compose down で停止する (always なら自動再起動)