使用 Docker 执行一条命令即可部署 Wekan

关于 Wekan

Wekan 是一个完全开源和免费的软件协作看板应用程序,具有 MIT 许可证。

无论您是维护个人待办事项清单,与朋友一起计划假期,还是在团队中为您的下一个革命性想法工作,看板都是一个无与伦比的工具,可以让您的事情井井有条。 它们为您提供项目当前状态的可视化概览,并通过让您专注于少数几个最重要的项目来提高您的工作效率。

由于 Wekan 是一款免费软件,您无需将数据交给我们,可以在您自己的计算机或服务器上安装 Wekan。 事实上,我们鼓励您通过在各种平台上提供一键安装来做到这一点。

本文将介绍如何通过 Docker 执行一条命令来部署 Wekan。

拉取 Wekan 源码

shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# ganzhixiong @ ganzhixiongdeMacBook-Pro in ~/Documents/Docker/wekan4 [10:39:07] 
$ git clone https://github.com/wekan/wekan ../wekan12
Cloning into '../wekan12'...
remote: Enumerating objects: 51346, done.
remote: Counting objects: 100% (1682/1682), done.
remote: Compressing objects: 100% (860/860), done.
remote: Total 51346 (delta 946), reused 1456 (delta 781), pack-reused 49664
Receiving objects: 100% (51346/51346), 36.35 MiB | 11.41 MiB/s, done.
Resolving deltas: 100% (38065/38065), done.

# ganzhixiong @ ganzhixiongdeMacBook-Pro in ~/Documents/Docker/wekan4 [10:51:26]
$ ../wekan12/

# ganzhixiong @ ganzhixiongdeMacBook-Pro in ~/Documents/Docker/wekan12 on git:master o [10:51:34]
$ ll
total 1536
-rw-r--r-- 1 ganzhixiong staff 360593 Aug 17 10:51 CHANGELOG.md
-rw-r--r-- 1 ganzhixiong staff 194 Aug 17 10:51 CONTRIBUTING.md
-rw-r--r-- 1 ganzhixiong staff 14319 Aug 17 10:51 Dockerfile
-rw-r--r-- 1 ganzhixiong staff 2609 Aug 17 10:51 Dockerfile.arm64v8
-rw-r--r-- 1 ganzhixiong staff 1086 Aug 17 10:51 LICENSE
-rw-r--r-- 1 ganzhixiong staff 8048 Aug 17 10:51 README.md
-rw-r--r-- 1 ganzhixiong staff 7001 Aug 17 10:51 SECURITY.md
-rw-r--r-- 1 ganzhixiong staff 263 Aug 17 10:51 Stackerfile.yml
-rwxr-xr-x 1 ganzhixiong staff 9771 Aug 17 10:51 api.py
-rwxr-xr-x 1 ganzhixiong staff 51 Aug 17 10:51 app.env
-rw-r--r-- 1 ganzhixiong staff 667 Aug 17 10:51 app.json
drwxr-xr-x 6 ganzhixiong staff 192 Aug 17 10:51 client
drwxr-xr-x 8 ganzhixiong staff 256 Aug 17 10:51 config
-rw-r--r-- 1 ganzhixiong staff 33700 Aug 17 10:51 docker-compose.yml
-rwxr-xr-x 1 ganzhixiong staff 133 Aug 17 10:51 find-replace.sh
-rwxr-xr-x 1 ganzhixiong staff 567 Aug 17 10:51 find.sh
drwxr-xr-x 3 ganzhixiong staff 96 Aug 17 10:51 fix-download-unicode
drwxr-xr-x 3 ganzhixiong staff 96 Aug 17 10:51 helm
drwxr-xr-x 68 ganzhixiong staff 2176 Aug 17 10:51 i18n
drwxr-xr-x 10 ganzhixiong staff 320 Aug 17 10:51 meta
drwxr-xr-x 43 ganzhixiong staff 1376 Aug 17 10:51 models
drwxr-xr-x 4 ganzhixiong staff 128 Aug 17 10:51 nginx
drwxr-xr-x 4 ganzhixiong staff 128 Aug 17 10:51 openapi
drwxr-xr-x 4 ganzhixiong staff 128 Aug 17 10:51 openshift
-rw-r--r-- 1 ganzhixiong staff 125 Aug 17 10:51 owasp-zap-scan.yml
-rw-r--r-- 1 ganzhixiong staff 171775 Aug 17 10:51 package-lock.json
-rw-r--r-- 1 ganzhixiong staff 1318 Aug 17 10:51 package.json
drwxr-xr-x 31 ganzhixiong staff 992 Aug 17 10:51 packages
drwxr-xr-x 32 ganzhixiong staff 1024 Aug 17 10:51 public
-rw-r--r-- 1 ganzhixiong staff 2808 Aug 17 10:51 rebuild-wekan.bat
-rwxr-xr-x 1 ganzhixiong staff 4727 Aug 17 10:51 rebuild-wekan.sh
drwxr-xr-x 45 ganzhixiong staff 1440 Aug 17 10:51 releases
-rw-r--r-- 1 ganzhixiong staff 8902 Aug 17 10:51 sandstorm-pkgdef.capnp
-rw-r--r-- 1 ganzhixiong staff 17091 Aug 17 10:51 sandstorm.js
-rw-r--r-- 1 ganzhixiong staff 301 Aug 17 10:51 scalingo.json
drwxr-xr-x 19 ganzhixiong staff 608 Aug 17 10:51 server
-rw-r--r-- 1 ganzhixiong staff 2 Aug 17 10:51 settings.json
drwxr-xr-x 4 ganzhixiong staff 128 Aug 17 10:51 snap
drwxr-xr-x 4 ganzhixiong staff 128 Aug 17 10:51 snap-src
-rw-r--r-- 1 ganzhixiong staff 6446 Aug 17 10:51 snapcraft.yaml
drwxr-xr-x 3 ganzhixiong staff 96 Aug 17 10:51 stacksmith
-rw-r--r-- 1 ganzhixiong staff 17059 Aug 17 10:51 start-wekan.bat
-rwxr-xr-x 1 ganzhixiong staff 23239 Aug 17 10:51 start-wekan.sh
-rwxr-xr-x 1 ganzhixiong staff 191 Aug 17 10:51 status-wekan.sh
-rwxr-xr-x 1 ganzhixiong staff 35 Aug 17 10:51 stop-wekan.sh
-rw-r--r-- 1 ganzhixiong staff 708 Aug 17 10:51 support-at-wekan.team_pgp-publickey.asc
-rwxr-xr-x 1 ganzhixiong staff 2459 Aug 17 10:51 test-wekan.sh
drwxr-xr-x 3 ganzhixiong staff 96 Aug 17 10:51 tests
drwxr-xr-x 6 ganzhixiong staff 192 Aug 17 10:51 torodb-postgresql
drwxr-xr-x 3 ganzhixiong staff 96 Aug 17 10:51 trello
-rw-r--r-- 1 ganzhixiong staff 244 Aug 17 10:51 wekan-dockerfile-manifest.yaml

配置 docker-compose.yml 文件

修改 wekandb 容器名称

docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
services:

wekandb:
#-------------------------------------------------------------------------------------
# ==== MONGODB AND METEOR VERSION ====
# a) mongodb latest, like 3.2 - 4.4 or newer https://hub.docker.com/_/mongo?tab=description
# 2020-12-03:
# - Mongo image copied from Docker Hub mongo:4.4.2-bionic to Quay
# to avoid Docker Hub rate limits.
# Quay image does work:
# image: quay.io/wekan/mongo:4.4.2-bionic
# Docker Hub MongoDB image does work:
image: mongo:4.4
#-------------------------------------------------------------------------------------
- container_name: wekan-db
+ container_name: wekan-db12
restart: always
# command: mongod --oplogSize 128
# Syslog: mongod --syslog --oplogSize 128 --quiet
# Disable MongoDB logs:
command: mongod --logpath /dev/null --oplogSize 128 --quiet
networks:
- wekan-tier
expose:
- 27017
volumes:
- wekan-db:/data/db
- wekan-db-dump:/dump

修改 wekan 容器的名称、端口号、地址

docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  wekan:
#-------------------------------------------------------------------------------------
# ==== MONGODB AND METEOR VERSION ====
+ # 关于 quay.io/wekan/wekan 和 wekanteam/wekan 的区别,请看 https://github.com/wekan/wekan/issues/1914
# a) Quay automatic builds do work work, https://quay.io/wekan/wekan
# image: quay.io/wekan/wekan
# b) Using specific version tag:
# image: quay.io/wekan/wekan:v4.52
# c) Docker Hub builds do work https://hub.docker.com/r/wekanteam/wekan
image: wekanteam/wekan
#-------------------------------------------------------------------------------------
- container_name: wekan-app
+ container_name: wekan-app12
restart: always
networks:
- wekan-tier
#-------------------------------------------------------------------------------------
# ==== BUILD wekan-app DOCKER CONTAINER FROM SOURCE, if you uncomment these ====
# ==== and use commands: docker-compose up -d --build
#build:
# context: .
# dockerfile: Dockerfile
#-------------------------------------------------------------------------------------
ports:
# Docker outsideport:insideport. Do not add anything extra here.
# For example, if you want to have wekan on port 3001,
# use 3001:8080 . Do not add any extra address etc here, that way it does not work.
# remove port mapping if you use nginx reverse proxy, port 8080 is already exposed to wekan-tier network
- - 80:8080
+ # hostPort:containerPort。将容器内部端口8080映射到外部宿主机端口8082。
+ - 8082:8080
environment:
- MONGO_URL=mongodb://wekandb:27017/wekan
#---------------------------------------------------------------
# ==== ROOT_URL SETTING ====

# ROOT_URL 是必填的,不然wekan都打开不
# Change ROOT_URL to your real Wekan URL, for example:
# If you have Caddy/Nginx/Apache providing SSL
# - https://example.com
# - https://boards.example.com
# This can be problematic with avatars https://github.com/wekan/wekan/issues/1776
# - https://example.com/wekan
# If without https, can be only wekan node, no need for Caddy/Nginx/Apache if you don't need them
# - http://example.com
# - http://boards.example.com
# - http://192.168.1.100 <=== using at local LAN
#- ROOT_URL=http://localhost # <=== using only at same laptop/desktop where Wekan is installed

+ # 用下面三种方式都可以在局域网中访问到
+ - ROOT_URL=http://192.168.0.4
+ # - ROOT_URL=http://127.0.0.1
+ # - ROOT_URL=http://0.0.0.0

一条命令部署

shell
1
2
3
4
5
6
7
# ganzhixiong @ ganzhixiongdeMacBook-Pro in ~/Documents/Docker/wekan12 on git:master o [11:08:55] 
$ docker-compose up -d
Creating network "wekan12_wekan-tier" with driver "bridge"
Creating volume "wekan12_wekan-db" with local driver
Creating volume "wekan12_wekan-db-dump" with local driver
Creating wekan-db12 ... done
Creating wekan-app12 ... done
shell
1
2
3
4
5
# ganzhixiong @ ganzhixiongdeMacBook-Pro in ~/Documents/Docker/wekan12 on git:master x [11:12:29] 
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ef8650e187f4 quay.io/wekan/wekan "node /build/main.js" 4 seconds ago Up 3 seconds 0.0.0.0:8082->8080/tcp, :::8082->8080/tcp wekan-app12
6f91e0465e86 mongo:4.4 "docker-entrypoint.s…" 5 seconds ago Up 3 seconds 27017/tcp wekan-db12

浏览器中打开

点击 http://localhost:8082 在浏览器中打开 Wekan。

第一个注册用户将是管理员,然后是普通用户。如果您也需要其他管理员,您可以在管理面板中将他们的权限更改为管理员。

如果注册的时候提示“内部服务器错误”,这是正常的,是因为你没有配置电子邮件。具体请看 https://github.com/wekan/wekan/wiki/Adding-users

Wekan 创建账号

使用 Docker 执行一条命令即可部署 Wekan

https://ganzhixiong.com/p/464eea27/

Author

干志雄

Posted on

2021-08-17

Updated on

2021-08-17

Licensed under

Comments