diff --git a/git.yaml b/git.yaml new file mode 100644 index 0000000..b285967 --- /dev/null +++ b/git.yaml @@ -0,0 +1,51 @@ +version: "3.3" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:1.9 + environment: + - USER_UID=1002 + - USER_GID=1002 + - DB_TYPE=mysql + - DB_HOST=db:3306 + - DB_NAME=gitea + - DB_USER=gitea + - DB_PASSWD=gitea + restart: always + networks: + - gitea + volumes: + - /var/lib/gitea:/data + ports: + - "3000:3000" + - "3080:3080" + - "127.0.0.1:2222:22" + depends_on: + - db + deploy: + placement: + constraints: + - node.id == ${REGISTERid} + + + db: + image: mysql:5.7 + restart: always + environment: + - MYSQL_ROOT_PASSWORD=gitea + - MYSQL_USER=gitea + - MYSQL_PASSWORD=gitea + - MYSQL_DATABASE=gitea + networks: + - gitea + volumes: + - /var/lab/gitea/mysql:/var/lib/mysql + deploy: + placement: + constraints: + - node.id == ${REGISTERid} + diff --git a/git.yaml.sh b/git.yaml.sh new file mode 100755 index 0000000..3a41e4a --- /dev/null +++ b/git.yaml.sh @@ -0,0 +1 @@ +env REGISTERid=c50xzv12mz3cux1mcdz4ypznc docker stack deploy -c git.yaml git