问题描述
我试图通过traefik启动两个具有不同数据库的wikijs容器。我没有启动容器的问题。我可以在子域上启动traefik,甚至可以在不同的子域上启动两个wiki。我的问题如下:每次启动wikijs容器时,我总是以某种方式使用相同的数据库,而我不知道如何更改它。
目的是,我有一些客户希望为其文档提供单独的Wiki。因此,我想启动尽可能多的wikijs容器,但最好通过一个docker-compose.yml文件启动。
有人可以告诉我,我做错了吗?谢谢=)
这是我的traefik.toml文件:
for
这是我的docker-compose.yml文件:
defaultEntryPoints = ["http","https"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[entryPoints.dashboard]
address = ":8080"
[entryPoints.dashboard.auth]
[entryPoints.dashboard.auth.basic]
users = ["admin:$apr1$Ld55R9Cl$/8W5BCc.J/Qtg9Xtpk4lq0"]
[api]
entrypoint="dashboard"
[acme]
email = "email@domain.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
解决方法
两个数据库都在同一网络上:
networks:
- internal
并在同一端口上监听:
DB_PORT: 5432
因此,将每个数据库放入其自己的网络中,然后将该网络添加到Wiki服务中,或者更改其中一个正在侦听的端口。