version: '3.8' # Deploy with: # docker stack deploy -c mariadb.yml mariadb # # Runs on: adder-ghost services: mariadb: image: mariadb:11 environment: MYSQL_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD} ports: - target: 3306 published: 3306 protocol: tcp mode: host volumes: - mariadb_data:/var/lib/mysql networks: - overlay-net deploy: replicas: 1 placement: constraints: - node.hostname == adder-ghost restart_policy: condition: on-failure delay: 5s max_attempts: 3 volumes: mariadb_data: networks: overlay-net: external: true name: ${OVERLAY_NETWORK:-homelab-net}