SUSE Linux + Docker + Discourse



Install Docker:

  1. Install the Docker package:

         $ sudo zypper in docker

     

  2. Start the Docker daemon:

    $ sudo systemctl start docker

     

  3. Test the Docker installation:

    $ sudo docker run hello-world

Install Discourse:

  1. Create a folder for Discourse:

    $ mkdir  /var/discourse

     

  2. Download discourse file:

    $ git clone https://github.com/discourse/discourse_docker.git    /var/discourse

     

  3. Copy standalone.yml  to containers/app.yml

    $ cd  /var/discourse

    $ cp samples/standalone.yml  containers/app.yml

     

  4. Edit Discourse configuration:

    $ vi containters/app.yml

templates:

  - "templates/postgres.template.yml"

  - "templates/redis.template.yml"

  - "templates/sshd.template.yml"

  - "templates/web.template.yml"

  - "templates/web.ratelimited.template.yml"

  - "templates/web.socketed.template.yml"

expose:

   # base on actualsituation

  - "8080:6379"   # fwd host port 8080 to container port 6379(http)

  - "2222:22"

params:

  db_default_text_search_config: "pg_catalog.english"

env:

  LANG: en_US.UTF-8

  DISCOURSE_DEFAULT_LOCALE: en

  DISCOURSE_DEVELOPER_EMAILS:'shijian.zou@ericsson.com'

# base on actual situation

  DISCOURSE_HOSTNAME: '150.236.39.111:8081'

# base on actual situation

  DISCOURSE_SMTP_ADDRESS: 150.236.39.117 #(mandatory)

  DISCOURSE_SMTP_PORT: 25    # (optional)

  HTTP_PROXY: 153.88.253.150:8080

  HTTPS_PROXY: 153.88.253.150:8080

volumes:

  - volume:

      host: /var/discourse/shared/standalone

      guest: /shared

  - volume:

      host: /var/discourse/shared/standalone/log/var-log

      guest: /var/log

hooks:

  after_code:

    - exec:

        cd: $home/plugins

        cmd:

          - mkdir-p plugins

          - gitclone https://github.com/discourse/docker_manager.git

          - gitclone https://github.com/discourse/discourse-solved.git

          - gitclone https://github.com/Jake-Shadle/discourse_jira.git

          - gitclone https://github.com/PoloGT/abbreviation-discourse-plugin.git

run:

  - exec: echo "Beginning of custom commands"

  - exec: /usr/sbin/usermod -p 'PASSWORD_HASH'root

  - exec:/usr/sbin/usermod -p "$(mkpasswd -m sha-256'RAW_PASSWORD')" root

  - exec: echo "End of custom commands"

 

More details about the meaningof node please see the note in app.yml file.

 

  1. Save the app.yml file, and begin bootstrappingDiscourse(between 2-8 minutes):

    $./launcher bootstrap app

     

  2. Start Discourse:

    $./launcher start app

    If all goes well, you can see the belowinformation.

HTTP Proxy Settings(optional):

  1. Install nginx

    Refer to install nginx on suse

  2. Configure nginx

    $ vi/usr/local/nginx/conf/nginx.conf

    Add a server  block as below:

server {

# base on actual situation

listen 8081; #listen[::]:8081;

server_name forum.jcat.com;

 

location / {

proxy_pass                                      http://unix:/var/discourse/shared/standalone/nginx.http.sock:;

proxy_set_header Host $http_host;

proxy_http_version 1.1;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

}

 

  1. Reload ngnix:

    $ cd/usr/local/nginx/sbin

    $  ./nginx -s reload

Congratulations!  YourDiscourse should be accessible in your web browser by http://ip:8081.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值