1
0
Fork 0

Replace gitlab by gitea (Reduce RAM and CPU Usage)

This commit is contained in:
Florian RICHER 2023-10-15 21:06:26 +02:00
parent 11a4ecd6d5
commit 504e2e4b4c
4 changed files with 72 additions and 1 deletions

View file

@ -16,7 +16,8 @@
- { role: home_assistant, tags: ["home_assistant"] }
- { role: n8n, tags: ["n8n"] }
- { role: matrix, tags: ["matrix"] }
- { role: gitlab, tags: ["gitlab"] }
# - { role: gitlab, tags: ["gitlab"] }
- { role: gitea, tags: ["gitea"] }
- { role: iptables, tags: ["iptables"] }
- { role: borg, tags: ["borg"] }
- { role: watchtower, tags: ["watchtower"] }

View file

@ -0,0 +1,22 @@
---
- name: Check gitea directory exist
ansible.builtin.file:
path: gitea
state: directory
- name: Copy template conf
ansible.builtin.template:
src: "{{ item.src }}"
dest: "gitea/{{ item.dest }}"
loop:
- { src: 'docker-compose.yml', dest: 'docker-compose.yml' }
register: gitea_copy_templates_results
- name: Update and restart container
community.docker.docker_compose:
project_src: gitea
state: present
pull: true
restarted: "{{ gitea_copy_templates_results.changed }}"
become: true

View file

@ -0,0 +1,4 @@
---
- ansible.builtin.import_tasks: base.yml
name: base

View file

@ -0,0 +1,44 @@
version: "3"
services:
gitea:
image: gitea/gitea:latest
environment:
- USER_UID=1000
- USER_GID=1000
container_name: gitea
restart: unless-stopped
volumes:
- {{ server.work_dir }}/gitea/data/:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
- proxy
- interne
labels:
- traefik.enable=true
- traefik.docker.network=proxy
# HTTP Reverse proxy Gitea
- traefik.http.routers.gitea-secure.entrypoints=https
- traefik.http.routers.gitea-secure.rule=Host(`gitea.{{ server.domain }}`)
- traefik.http.routers.gitea-secure.tls=true
- traefik.http.routers.gitea-secure.tls.certresolver=sslResolver
- traefik.http.routers.gitea-secure.service=gitea
- traefik.http.services.gitea.loadbalancer.server.port=3000
# TCP SSH Reverse proxy Gitlab
- traefik.tcp.routers.gitea-ssh.rule=HostSNI(`*`)
- traefik.tcp.routers.gitea-ssh.entrypoints=ssh
- traefik.tcp.routers.gitea-ssh.service=gitea-ssh
- traefik.tcp.services.gitea-ssh.loadbalancer.server.port=22
logging:
driver: loki
options:
loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push"
mode: non-blocking
networks:
interne:
metrics:
external: true
proxy:
external: true