corselia
2/11/2018 - 2:15 PM

the example of crowi-plus on docker

the example of crowi-plus on docker

version: '3'

services:
  app:
    build:
      context: .
      dockerfile: ./Dockerfile
    container_name: foobar-crowi-plus-app
    hostname: foobar_crowi_plus_app
    ports:
      - 12345:3000
    links:
      - mongo:mongo
      - redis:redis
      - elasticsearch:elasticsearch
    depends_on:
      - mongo
      - redis
      - elasticsearch
    environment:
      - MONGO_URI=mongodb://mongo:27017/crowi
      - REDIS_URL=redis://redis:6379/crowi
      - ELASTICSEARCH_URI=http://elasticsearch:9200/crowi
      - PASSWORD_SEED=foobarfoobarfoobarfoobar
      - FILE_UPLOAD=local
    command: "dockerize
              -wait tcp://mongo:27017
              -wait tcp://redis:6379
              -wait tcp://elasticsearch:9200
              -timeout 60s
              npm run server:prod"
    volumes:
      - ./volumes/app_data:/data
      # - ./volumes/public:/opt/crowi-plus/public # 最初の起動時にビルドされた js を手元に持ってくる必要がある

  mongo:
    container_name: foobar-crowi-plus-mongo
    hostname: foobar_crowi_plus_mongo
    image: mongo:3.4
    volumes:
      - ./volumes/mongo_config_db:/data/configdb
      - ./volumes/mongo_db:/data/db

  redis:
    container_name: foobar-crowi-plus-redis
    hostname: foobar_crowi_plus_redis
    image: redis:3-alpine
    volumes:
      - ./volumes/redis_data:/data

  elasticsearch:
    container_name: foobar-crowi-plus-elasticsearch
    hostname: foobar_crowi_plus_elasticsearch
    image: elasticsearch:5.3-alpine
    environment:
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
    command:
      - sh
      - -c
      - "./bin/elasticsearch-plugin list | grep -q analysis-kuromoji || ./bin/elasticsearch-plugin install analysis-kuromoji;
        ./bin/elasticsearch-plugin list | grep -q analysis-icu || ./bin/elasticsearch-plugin install analysis-icu;
        /docker-entrypoint.sh elasticsearch"
    volumes:
      - ./es_data:/usr/share/elasticsearch/data
      - ./es_plugins:/usr/share/elasticsearch/plugins
      - ./es_config:/usr/share/elasticsearch/config