Containers on the node are not active

I’m just starting out in the Docker world and needed the following help.

I uploaded an ec2 to AWS to be my manager and I created another machine here at work to be my service, in this case Postgres.
But I can connect the server to my server with the manager but when I upload the application the container does not become active.

I released all the ports that docker swarm requests on the aws instance and on my miktroik to be able to connect to the node that is here.

I’m just finding it very strange because the service is active but it doesn’t appear with the other containers but inside the node the postgres container is running normally

I can’t add more photos, but I’ll share the yaml files I used

version: "3.8"

services:

  traefik:
    image: traefik:v2.11
    command:
      - "--api.dashboard=true"
      - "--providers.docker.swarmMode=true"
      - "--providers.docker.endpoint=unix:///var/run/docker.sock"
      - "--providers.docker.exposedbydefault=false"
      - "--providers.docker.network=network_public"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
      - "--entrypoints.web.http.redirections.entrypoint.permanent=true"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.letsencryptresolver.acme.httpchallenge=true"
      - "--certificatesresolvers.letsencryptresolver.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.letsencryptresolver.acme.email=jediael.reis@portalcci.com.br"
      - "--certificatesresolvers.letsencryptresolver.acme.storage=/etc/traefik/letsencrypt/acme.json"
      - "--log.level=DEBUG"
      - "--log.format=common"
      - "--log.filePath=/var/log/traefik/traefik.log"
      - "--accesslog=true"
      - "--accesslog.filepath=/var/log/traefik/access-log"
    deploy:
      placement:
        constraints:
          - node.role == manager
      restart_policy:
        condition: on-failure
        delay: 5s
      labels:
        - "traefik.enable=true"
        - "traefik.http.middlewares.redirect-https.redirectscheme.scheme=https"
        - "traefik.http.middlewares.redirect-https.redirectscheme.permanent=true"
        - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
        - "traefik.http.routers.http-catchall.entrypoints=web"
        - "traefik.http.routers.http-catchall.middlewares=redirect-https@docker"
        - "traefik.http.routers.http-catchall.priority=1"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "vol_certificates:/etc/traefik/letsencrypt"
    ports:
      - target: 80
        published: 80
        mode: host
      - target: 443
        published: 443
        mode: host
    networks:
      - network_public

volumes:

  vol_shared:
    external: true
    name: volume_swarm_shared
  vol_certificates:
    external: true
    name: volume_swarm_certificates

networks:

  network_public:
    external: true
    name: network_public


version: "3.7"

services:

  agent:
    image: portainer/agent:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/volumes:/var/lib/docker/volumes
    networks:
      - minha_rede
    deploy:
      mode: global
      placement:
        constraints: [node.platform.os == linux]

  portainer:
    image: portainer/portainer-ce:latest
    command: -H tcp://tasks.agent:9001 --tlsskipverify
    volumes:
      - portainer_data:/data
    networks:
      - minha_rede
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.role == manager]
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=minha_rede"
        - "traefik.http.routers.portainer.rule=Host(`portainer.portalcci.com.br`)"
        - "traefik.http.routers.portainer.entrypoints=websecure"
        - "traefik.http.routers.portainer.priority=1"
        - "traefik.http.routers.portainer.tls.certresolver=letsencryptresolver"
        - "traefik.http.routers.portainer.service=


        "
        - "traefik.http.services.portainer.loadbalancer.server.port=9000"

networks:
  minha_rede:
    external: true
    attachable: true
    name: minha_rede

volumes:
  portainer_data:
    external: true
    name: portainer_data
version: "3.8"

services:
  postgres:
    image: postgres:16
    environment:
      - POSTGRES_PASSWORD=senha34425a@
    networks:
      - network_public
      
    #ports:
    #  - 5432:5432
    volumes:
      - postgres_data:/var/lib/postgresql/data
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.hostname == worker1
      resources:
        limits:
          cpus: "0.5"
          memory: 1024M

volumes:
  postgres_data:
    external: true
    name: postgres_data

networks:
  network_public:
    external: true
    name: network_public

inside worker server 1 the container is running normally

You can get a general overview with

docker node ls 
docker stack ls
docker service ls
docker container ps -a

and check for dedicated services with

docker service ps <service-name>

What container is not active? Is it running? Not available via Traefik?

Note that Docker volumes are not shared across nodes.