GROWI를 docker로 바꾸어보십시오.

10199 단어 letsencryptGrowi도커


전제 조건


  • ec2 (Amazon Linux 2) 사용
  • docker-compose가 설치되었습니다
  • letsencrypt를 사용하여 SSL로 연결

  • letsencrypt + nginx-proxy 설정


    $ mkdir -p ~/docker/nginx-proxy
    $ cd ~/docker/nginx-proxy
    $ vim docker-compose.yml
    
    version: '3'
    
    services:
      nginx-proxy:
        image: jwilder/nginx-proxy
        restart: on-failure
        labels:
          - com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=jwilder/nginx-proxy
        ports:
          - 80:80
          - 443:443
        volumes:
          - proxy:/etc/nginx/vhost.d
          - proxy:/usr/share/nginx/html
          - /var/run/docker.sock:/tmp/docker.sock:ro
          - ./certs:/etc/nginx/certs:ro
        network_mode: bridge
    
      letsencrypt:
        image: jrcs/letsencrypt-nginx-proxy-companion
        restart: on-failure
        depends_on:
          - nginx-proxy
        volumes:
          - proxy:/etc/nginx/vhost.d
          - proxy:/usr/share/nginx/html
          - /var/run/docker.sock:/var/run/docker.sock:ro
          - ./certs:/etc/nginx/certs:rw
        network_mode: bridge
    
    volumes:
      proxy:
    

    nginx-proxy 시작


    $ docker-compose up -d
    

    install growi-docker-compose


    $ cd ~/docker
    $ git clone https://github.com/weseek/growi-docker-compose.git growi
    $ cd growi
    

    docker-compose.yml 편집


  • 코멘트를 참고로 수정을 합니다
  • version: '3'
    
    services:
      app:
        restart: on-failure # [追加]
        network_mode: bridge # [追加]
        build:
          context: .
          dockerfile: ./Dockerfile
        ports:
          - 3000:3000 # [変更]
        links:
          - mongo:mongo
          - elasticsearch:elasticsearch
        depends_on:
          - mongo
          - elasticsearch
        environment:
          - VIRTUAL_HOST=growi.example.com # [追加] SSLで利用したいFQDN
          - LETSENCRYPT_HOST=growi.example.com # [追加] SSLで利用したいFQDN
          - [email protected] # [追加] letsencryptに登録するE-Mail
          - MONGO_URI=mongodb://mongo:27017/growi
          - ELASTICSEARCH_URI=http://elasticsearch:9200/growi
          - PASSWORD_SEED=change # [変更] ランダムな64文字に置き換える!!
          - FILE_UPLOAD=local
        command: "dockerize
                  -wait tcp://mongo:27017
                  -wait tcp://elasticsearch:9200
                  -timeout 60s
                  npm run server:prod"
        volumes:
          - growi_data:/data
    
      mongo:
        restart: on-failure # [追加]
        network_mode: bridge # [追加]
        image: mongo:3.4
        volumes:
          - mongo_configdb:/data/configdb
          - mongo_db:/data/db
    
      elasticsearch:
        restart: on-failure # [追加]
        network_mode: bridge # [追加]
        image: elasticsearch:5.3-alpine
        environment:
          - "ES_JAVA_OPTS=-Xms256m -Xmx256m"  # increase amount if you have enough memory
        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
          - ./esconfig:/usr/share/elasticsearch/config
    
    volumes:
      growi_data:
      mongo_configdb:
      mongo_db:
      es_data:
      es_plugins:
    

    growi-docker-compose 시작


    $ docker-compose build
    $ docker-compose up -d
    

    마지막으로



    잠시 후 브라우저에서 https://${LETSENCRYPT_HOST}/에 액세스하면 growi 로그인 페이지가 표시됩니다.

    좋은 웹페이지 즐겨찾기