Kanboard - eine Open-Source Kanban Projektmanagement Software - im Docker Swarm mit einem (bereits existierenden) Traefik-Proxy und dem Docker-Image von WOAHBase…

Swarm Konfigurationsdatei

cat <<'EOF' > ./swarm.yml
version: '3.7'

services:
  app:
    image: woahbase/alpine-kanboard:latest
    logging:
      driver: json-file
      options:
        max-size: 10m
        max-file: 3
    networks:
      - traefik-net
      - internal
    env_file: ./kanboard.env
    volumes:
      - ./data:/config/www/kanboard/data
      - ./plugins:/config/www/kanboard/plugins
    deploy:
      replicas: 1
      labels:
        - "traefik.port=80"
        - "traefik.backend=kanboard"
        - "traefik.frontend.rule=Host:kanboard.mplx.demo"
        - "traefik.enable=true"
        - "traefik.frontend.entryPoints=https,http"
        - "traefik.docker.network=traefik-net"
        - "traefik.backend.loadbalancer.method=drr"
      restart_policy:
        condition: on-failure
        max_attempts: 3
      update_config:
        parallelism: 1
        delay: 5s
        failure_action: continue
        monitor: 10s
        max_failure_ratio: 0
  db:
    image: mariadb:latest
    logging:
      driver: json-file
      options:
        max-size: 10m
        max-file: 3
    networks:
      - internal
    env_file: ./database.env
    volumes:
      - ./database:/var/lib/mysql
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
        max_attempts: 10
      update_config:
        parallelism: 1
        delay: 5s
        failure_action: continue
        monitor: 5s
        max_failure_ratio: 0
networks:
  traefik-net:
    external: true
  internal:
EOF

Datenbank-Konfiguration

cat <<'EOF' > ./kanboard.env
DATABASE_URL=mysql://kanboard:secret@db/kanboarddb
EOF
cat <<'EOF' > ./database.env
MYSQL_ROOT_PASSWORD=secret
MYSQL_DATABASE=kanboarddb
MYSQL_USER=kanboard
MYSQL_PASSWORD=secret
EOF

Daten-Volumes

mkdir -pv ./data ./plugins ./cert ./database

Swarm Stack

docker stack deploy -c swarm.yml kanboard
docker service logs -f kanboard_app

Cleanup

docker stack rm todo
sleep 8
rm -Rf ./data ./plugins ./cert ./database