SUSE Linux + Docker + Discourse
2016-04-27 10:46
726 查看
$ sudo zypper in docker
Start the Docker daemon:
$ sudo systemctl start docker
Test the Docker installation:
$ sudo docker run hello-world
$ mkdir /var/discourse
Download discourse file:
$ git clone https://github.com/discourse/discourse_docker.git /var/discourse
Copy standalone.yml to containers/app.yml
$ cd /var/discourse
$ cp samples/standalone.yml containers/app.yml
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.
Save the app.yml file, and begin bootstrappingDiscourse(between 2-8 minutes):
$./launcher bootstrap app
Start Discourse:
$./launcher start app
If all goes well, you can see the belowinformation.
HTTP Proxy Settings(opti
Install nginx
Refer to install nginx on suse
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;
}
}
Reload ngnix:
$ cd/usr/local/nginx/sbin
$ ./nginx -s reload
Congratulations!
YourDiscourse should be accessible in your web browser by http://ip:8081.
Install Docker:
Install the Docker package:$ sudo zypper in docker
Start the Docker daemon:
$ sudo systemctl start docker
Test the Docker installation:
$ sudo docker run hello-world
Install Discourse:
Create a folder for Discourse:$ mkdir /var/discourse
Download discourse file:
$ git clone https://github.com/discourse/discourse_docker.git /var/discourse
Copy standalone.yml to containers/app.yml
$ cd /var/discourse
$ cp samples/standalone.yml containers/app.yml
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.
Save the app.yml file, and begin bootstrappingDiscourse(between 2-8 minutes):
$./launcher bootstrap app
Start Discourse:
$./launcher start app
If all goes well, you can see the belowinformation.
HTTP Proxy Settings(opti
9323
onal):
Install nginxRefer to install nginx on suse
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;
}
}
Reload ngnix:
$ cd/usr/local/nginx/sbin
$ ./nginx -s reload
Congratulations!
YourDiscourse should be accessible in your web browser by http://ip:8081.
相关文章推荐
- python脚本监控docker容器
- 用Spring Cloud和Docker构建微服务
- 一步步搭建docker私有仓库并从私有仓库中下载镜像
- docker常用命令
- centos7删除已经安装的docker
- docker -v挂载数据卷网络异常的问题
- 使用Docker、Registrator、Consul、Consul Template和Nginx实现高可扩展的Web框架
- Docker使用
- Docker--私有仓库构建--RHEL7.2
- python脚本监控docker容器
- docker安装及镜像加速
- apache mesos入门(6)——自定义framework在mesos上运行docker
- 【云计算虚拟化】docker在ubuntu14.04下的安装
- Docker--使用Dockerfile构建新镜像--RHEL7.2
- docker数据拷贝
- 通过nsenter连接docker容器
- Docker1.11新特性
- CentOS 7上安装Docker 1.8
- Docker--image分析
- Kubernetes1.2如何使用iptables