Compare commits

...

3 Commits

Author SHA1 Message Date
12b2248b74 wip replicasets 2022-07-21 13:11:54 +02:00
246a9229cb add mongodb replicaset mode 2022-06-22 15:04:19 +02:00
9224bb6238 chore: publish 0.6.0+v6.28 release 2022-06-22 13:54:25 +02:00
6 changed files with 46 additions and 10 deletions

View File

@ -4,10 +4,8 @@ SECRET_OAUTH2_SECRET_VERSION=v1
COMPOSE_FILE="compose.yml"
MONGO_URL=mongodb://db:27017/wekan
DOMAIN=board.example.com
ROOT_URL=https://board.example.com
DOMAIN=board.example.org
ROOT_URL=https://board.example.org
DEBUG=false
@ -28,7 +26,7 @@ RICHER_CARD_COMMENT_EDITOR=false
OAUTH2_ENABLED=false
# OAUTH2_LOGIN_STYLE=redirect
# OAUTH2_CLIENT_ID=wekan
# OAUTH2_SERVER_URL=https://sso.example.com
# OAUTH2_SERVER_URL=https://sso.${DOMAIN}
# OAUTH2_AUTH_ENDPOINT=/application/o/authorize/
# OAUTH2_USERINFO_ENDPOINT=/application/o/userinfo/
# OAUTH2_TOKEN_ENDPOINT=/application/o/token/

View File

@ -27,3 +27,12 @@ See original [docker-compose.yml](https://github.com/wekan/wekan/blob/master/doc
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
## use mongodb with replicaset
needed to enable oplog setting in wekan, which isneeded to run bigger instances?
after mongo conaintainer came up the first time run:
abra app command wekan.example.org db init_db

View File

@ -1,2 +1,3 @@
export SECRET_OAUTH2_SECRET_VERSION=v1
export ENTRYPOINT_VERSION=v2
export INIT_REPLICA_VERSION=v2

BIN
backup.db Normal file

Binary file not shown.

View File

@ -2,11 +2,15 @@ version: '3.8'
services:
db:
image: mongo:4.4
command: mongod --logpath /dev/null --oplogSize 128 --quiet
command: mongod --bind_ip_all --oplogSize 128 --replSet rs0
volumes:
- wekan-db:/data/db
networks:
- internal
configs:
- source: init-replica
target: /docker-entrypoint-initdb.d/init-replica.sh
mode: 0555
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet
interval: 30s
@ -21,9 +25,10 @@ services:
backupbot.backup.path: "/tmp/backup/"
app:
image: quay.io/wekan/wekan:v6.20
image: quay.io/wekan/wekan:v6.28
environment:
- MONGO_URL
- MONGO_URL=mongodb://db:27017/wekan?replicaSet=rs0
- MONGO_OPLOG_URL=mongodb://db:27017/local?replicaSet=rs0
- DOMAIN
- ROOT_URL
- DEBUG
@ -82,7 +87,7 @@ services:
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version=0.5.0+v6.20"
- "coop-cloud.${STACK_NAME}.version=0.6.0+v6.28"
volumes:
wekan-db:
@ -99,7 +104,9 @@ configs:
entrypoint:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
init-replica:
name: ${STACK_NAME}_init-replica_${INIT_REPLICA_VERSION}
file: init-replica.sh
secrets:
oauth2_secret:

21
init-replica.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/sh
set -e
#host=${HOSTNAME:-$(hostname -f)}
# shut down again
#mongod --pidfilepath /tmp/docker-entrypoint-temp-mongod.pid --shutdown
# # restart again binding to 0.0.0.0 to allow a replset with 10.7.7.6
# mongod --oplogSize 8 --replSet rs0 --noauth \
# --config /tmp/docker-entrypoint-temp-config.json \
# --bind_ip 0.0.0.0 --port 27017 \
# --tlsMode disabled \
# --logpath /proc/1/fd/1 --logappend \
# --pidfilepath /tmp/docker-entrypoint-temp-mongod.pid --fork
# init replset with defaults
mongo 0.0.0.0 --eval "rs.initiate()"
echo "Waiting to become a master"
echo 'while (!db.isMaster().ismaster) { sleep(100); }' | mongo
echo "I'm the master!"