S
S
saibaneko2019-08-06 11:17:06
YAML
saibaneko, 2019-08-06 11:17:06

How to build gitea in docker swarm?

Good afternoon, colleagues.
Tell me how to raise gitea in docker swarm? I am just starting to understand docker and docker swarm in particular, so I obviously make mistakes.
Wrote docker-compose with the following content:

version: '3.7'
networks:
  gitea-net:
    driver: overlay
    attachable: true
volumes:
  data: {}
  mysql: {}
services:
  gitea:
    image: 'gitea/gitea:1.9.0'
    volumes:
      - './gitea/data:/data'
    ports:
      - '3300:3000'
      - '3322:22'
    depends_on:
      - db
    restart: always
    networks:
      - gitea-net
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - 'node.role == manager'
  db:
    image: 'mariadb:10'
    volumes:
      - './gitea/mysql:/data'
    environment:
      - MYSQL_ROOT_PASSWORD=changeme
      - MYSQL_DATABASE=gitea
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=changeme
    restart: always
    networks:
      - gitea-net
    deploy:
      mode: global

When picked up, containers endlessly try to be created and collapse with a reject state. In the logs I found invalid mount config for type "bind": bind source path does not exist: /data/compose/1/gitea/mysql
I don't really understand where the piece "/data/compose/1/" came from. I didn't prescribe this. And on manager and worker, ./gitea/data and ./gitea/mysql are created in my home directory.
And is the section for mysql correct at all? Or should I read how to raise mysql cluster in docker swarm?
In general, I'm completely confused. Help me please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Shakhunov, 2019-08-06
@saibaneko

Volumes without quotes

volumes:
  - ./gitea/mysql:/data

S
saibaneko, 2019-08-06
@saibaneko

If you create /data/compose/DIG/gitea/data and /data/compose/DIG/gitea/mysql, then everything starts.
The question changes a bit then, where does /data/compose/ come from and how is the NUMBER determined (it seems to be the run number of the stack oO)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question