I'm going to separate some MoinMoin stateful data into a data volume container. In this way it can be done to maintain pages data individually. Going stateless is always good habits for Docker Way.
Iām going to separate some MoinMoin stateful data into a data volume container. In this way it can be done to maintain pages data individually. Going stateless is always good habits for Docker Way.
fleet unit files
A moin@.service requires a separated moin-data@.service unit, it will fail if a data volume container is not exists.
~/docker_apps/moin/system/moin@.service
[Unit] Description=MoinMoin Service Requires=%p-data@%i.service After=%p-data@%i.service
A moin-data@.service unit should be running before moin@.service. I do not ensure a BitTorrent Sync process is finished before running a moin@.service. I will fix this issue some time later.
~/docker_apps/moin/system/moin-data@.service
[Unit] Description=MoinMoin Data Service Requires=docker.service After=docker.service
This this script downloads the latest backup file from Dropbox and restores into BitTorrent Sync powered data volume container. The original plan was to schedule restoring jobs through cron every four hours. Owing to a strange befavior of sync and time consuming process, I stopped a cron job. From this time, I separate stateful date such as user accounts and SSL Certificate from MoinMoin container step by step.
~/bin/moin-update
#!/bin/bash set -eo pipefail
BACKUP_DIR=moin_backup
cd /tmp
LATEST_FILE=$($HOME/bin/dropbox_uploader.sh list /$BACKUP_DIR | tail -n +2 | awk '{print $3}' | sort -nr | head -1) $HOME/bin/dropbox_uploader.sh download /$BACKUP_DIR/$LATEST_FILE