I have a custom image of Gitea placed in a Docker Swarm, the implementation of the service is realized via Docker Compose. The issue is that, although I have specified that it has to run in global mode, it says global but I only have 1/1 replicas, that is wrong because I have two nodes in the swarm. The strange thing is that other services run in global mode correctly with 2/2 replicas. Can you tell me what is the problem?
This is the implementation on Docker compose:
...
gitea:
image: 127.0.0.1:5000/custom_gitea:92
restart: always
hostname: git.localdomain
build: /data/gitea/custom
# ports:
# - 4000:4000
# - 222:22
environment:
USER: git
USER_UID: 1000
USER_GID: 1000
GITEA__database__DB_TYPE: postgres
GITEA__database__HOST: db:5432
GITEA__database__NAME: gitea
GITEA__database__USER: gitea
GITEA__database__PASSWD: gitea
GITEA__security__INSTALL_LOCK: "true"
GITEA__security__SECRET_KEY: XQolFkmSxJWhxkZrkrGbPDbVrEwiZshnzPOY
volumes:
- /data/gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /data/gitea/app.ini:/data/gitea/conf/app.ini
deploy:
mode: global
depends_on:
- db
- openldap
- openldap_admin
networks:
- vcc
...
I solved the problem by building and pushing from both nodes with the new images into the registry. Now it works in global mode with 2/2 replicas.