docker-compose安装 wiki

所有的脚本在 Ubuntu 16.04 上测试过没有问题, 如果系统平台有变化, 可能需要做改动.

### 系统依赖

1. docker

1. docker-compose

1. nginx

#### docker

安装请参照这个 [[Shell脚本|https://github.com/DistPub/lightops/blob/master/docker/setup_docker_on_server.sh]]

配置请参照这个 [[Shell脚本|https://github.com/DistPub/lightops/blob/master/docker/make_docker_command_no_sudo.sh]]

#### docker-compose

安装请运行如下命令

```

sudo apt-get -y install python-pip; sudo pip install -U docker-compose

```

#### nginx

安装略

server配置如下

```

upstream wiki {

    ip_hash;

    server 0.0.0.0:4567;

}

server {

listen 80;

server_name cubead_wiki.smitechow.com;

location / {

auth_basic "请进行认证";

auth_basic_user_file conf.d/cubead_passwd;

proxy_set_header Host $host;

proxy_set_header X-Real-Ip $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://wiki;

}

}

```

conf.d/cubead_passwd 内容如下

```

cubead:$apr1$rQ2ezvqC$X5C11mJLenTTnMB2EXwFH.

```

### 迁移wiki page

运行如下命令

```

cd /home/$USER;

git clone https://github.com/lovemyliwu/cubead_wiki.git

```

### 启动wiki软件

保存如下内容到`/home/$USER/docker-compose.yml`

```

wiki:

    image: registry.cn-hangzhou.aliyuncs.com/ugoodspeed/wiki:v1

    container_name: wiki

    restart: always

    volumes:

        - ~/cubead_wiki:/wiki

    ports:

        - 4567:80

```

运行如下命令

```

cd /home/$USER;

docker-compose up -d

```

你可能感兴趣的:(docker-compose安装 wiki)