openSUSE Brazil Docker Swarm deployment
- The storage disk has at least 1 TB free
- The host path where files are going to be stored is
/storage/opensuse
- The owner of
/storage/opensuse
is the user:groud defined byRSYNC_CHOWN
- The Swarm cluster is empty
- The load balancer/proxy/ingress is Traefik
- The domain name is configured, uses CloudFlare DNS and Let's Encrypt for certificates
Before deployment you need to setup and configure some items.
Create a network for Traefik and all services.
docker network create --driver overlay traefik
Create the data volumes.
docker volume create --name opensuse-data --opt type=none --opt device=/storage/opensuse --opt o=bind
docker volume create --name packman-data --opt type=none --opt device=/storage/packman --opt o=bind
Create the fancyindex volumes, this allows to edit the nginx fancyindex HTMLs.
docker volume create opensuse-fancyindex
docker volume create packman-fancyindex
Create a config that contains the CF API Token.
docker config create cf-dns-api-token cf-dns-api-token.txt
Create a config that contains the user:password
for Traefik Web UI.
docker config create traefik-users-file traefik-users-file.txt
Use
htpasswd -n <user>
to create an encoded password.
Create the configs that will hold the rsync include pattern.
docker config create opensuse-rsync-include opensuse-include.txt
docker config create packman-rsync-include packman-include.txt
Deploy Traefik first as other services may depend on it.
docker stack deploy -c traefik.yml traefik
Deploy CronJob as other services may depend on it.
docker stack deploy -c cronjob.yml cronjob
Deploy mirror services.
docker stack deploy -c opensuse-mirror.yml opensuse
docker stack deploy -c packman-mirror.yml packman