Docker Community Forums

Share and learn in the Docker community.

My services do not replicate

My swarm is not replicating my global services to another nodes.

my stack:

version: "3"
services:
    emailer:
        image: "127.0.0.1/emailer"
        deploy:
            mode: global
            restart_policy:
                condition: any
    migrations:
        image: "127.0.0.1/migrations"
        working_dir: /home/node
        volumes:
            - ./scripts/:/home/node/scripts/
        command: "./scripts/migrations-init.sh"
        env_file:
            - .env
        deploy:
            replicas: 1
            restart_policy:
                condition: on-failure
    scheduler:
        image: "127.0.0.1/scheduler"
        working_dir: /home/node
        volumes:
            - ./scripts/:/home/node/scripts/
        command: "./scripts/scheduler-init.sh"
        env_file:
            - .env
        deploy:
            replicas: 1
            restart_policy:
                condition: any
    worker:
        image: "127.0.0.1/worker"
        working_dir: /home/node
        env_file:
            - .env
        deploy:
            replicas: 1
            restart_policy:
                condition: any
    pusher:
        image: "127.0.0.1/pusher"
        working_dir: /home/node
        networks:
            - proxy
        env_file:
            - .env
        deploy:
            mode: global
            restart_policy:
                condition: any
            labels:
                - "traefik.enable=true"
                - "traefik.ws.protocol=http"
                - "traefik.http.routers.pusher.rule=Host(`pusher.singulariot.tech`)"
                - "traefik.http.routers.pusher.entrypoints=web"
                - "traefik.http.services.pusher.loadbalancer.server.port=3001"
        ports:
            - 3001:3001
    api:
        image: "127.0.0.1/api"
        working_dir: /home/node
        networks:
            - proxy
        env_file:
            - .env
        deploy:
            mode: global
            restart_policy:
                condition: any
            labels:
                - "traefik.enable=true"
                - "traefik.http.routers.api.rule=Host(`api.singulariot.tech`)"
                - "traefik.http.routers.api.entrypoints=websecure"
                - "traefik.http.routers.api.tls.certresolver=letsencryptresolver"
                - "traefik.http.services.api.loadbalancer.server.port=3030"
        ports:
            - 3030:3030
    visualizer:
        image: dockersamples/visualizer
        ports:
            - 8080:8080
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock:ro
        networks:
            - proxy
        deploy:
            labels:
                - "traefik.enable=true"
                - "traefik.http.routers.vizu.entrypoints=viz"
                - "traefik.http.routers.vizu.middlewares=traefik-auth"
                - "traefik.http.middlewares.traefik-auth.basicauth.users=manbomb:############"
                - "traefik.http.services.vizu.loadbalancer.server.port=8080"
            replicas: 1
            placement:
                constraints:
                    - node.role == manager
    reverse-proxy:
        image: traefik:v2.3.4
        command:
            #- "--log.level=DEBUG"
            - "--api.dashboard=true"
            - "--providers.docker.endpoint=unix:///var/run/docker.sock"
            - "--providers.docker.swarmMode=true"
            - "--providers.docker.exposedbydefault=false"
            - "--providers.docker.network=proxy"
            - "--entrypoints.web.address=:80"
            - "--entrypoints.websecure.address=:443"
            - "--entrypoints.viz.address=:8080"
            - "--certificatesresolvers.letsencryptresolver.acme.httpchallenge=true"
            - "--certificatesresolvers.letsencryptresolver.acme.httpchallenge.entrypoint=web"
            - "--certificatesresolvers.letsencryptresolver.acme.email=sergiolucasavilladasilva@gmail.com"
            - "--certificatesresolvers.letsencryptresolver.acme.storage=/letsencrypt/acme.json"
        ports:
            - 80:80
            - 443:443
        volumes:
            - ./letsencrypt:/letsencrypt
            - /var/run/docker.sock:/var/run/docker.sock:ro
        networks:
            - proxy
        deploy:
            labels:
                - "traefik.enable=true"
                - "traefik.http.services.traefik.loadbalancer.server.port=888"
                - "traefik.http.routers.traefik.rule=Host(`traefik.singulariot.tech`)"
                - "traefik.http.routers.traefik.service=api@internal"
                - "traefik.http.routers.traefik.middlewares=traefik-auth"
                - "traefik.http.middlewares.traefik-auth.basicauth.users=manbomb:##############"
            resources:
                limits:
                    cpus: '0.2'
                    memory: 200M
                reservations:
                    cpus: '0.1'
                    memory: 100M
            replicas: 1
            placement:
                constraints:
                    - node.role == manager
networks:
    proxy:
        external: true

an example of script:

apk update
apk upgrade
apk add bash git openssh
git clone https://###########@github.com/########/sing-emailer-be.git
cd sing-emailer-be
npm i
npm start

i dont know why, can you help me?