homelab/roles/gitea/tasks/main.yml

55 lines
1.7 KiB
YAML
Raw Normal View History

2020-07-28 03:20:50 +00:00
- name: Create Gitea Network
docker_network:
name: "{{ gitea_name }}"
- name: Start Gitea's database container
docker_container:
name: "{{ gitea_dbname }}"
image: mariadb:{{ gitea_dbversion }}
2020-07-29 04:43:31 +00:00
state: started
2020-07-28 03:20:50 +00:00
restart_policy: always
volumes: "{{ gitea_dbroot }}:/var/lib/mysql"
networks_cli_compatible: true
networks:
- name: "{{ gitea_name }}"
env:
MYSQL_RANDOM_ROOT_PASSWORD: "true"
MYSQL_DATABASE: "{{ gitea_dbname }}"
MYSQL_USER: "{{ gitea_dbuser }}"
MYSQL_PASSWORD: "{{ gitea_dbpass }}"
- name: Start Gitea container
docker_container:
name: "{{ gitea_name }}"
image: gitea/gitea:{{ gitea_version }}
2020-07-29 04:43:31 +00:00
state: started
2020-07-28 03:20:50 +00:00
restart_policy: always
networks_cli_compatible: true
2020-09-12 04:32:34 +00:00
ports: "{{ gitea_ports }}"
2020-07-28 03:20:50 +00:00
networks:
- name: "{{ gitea_name }}"
- name: traefik
volumes:
- "{{ gitea_root }}:/data"
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
env:
USER_UID: "1000"
USER_GID: "1000"
DB_TYPE: mysql
DB_HOST: "{{ gitea_dbname }}"
DB_NAME: "{{ gitea_dbname }}"
DB_USER: "{{ gitea_dbuser }}"
DB_PASSWD: "{{ gitea_dbpass }}"
2020-09-20 06:33:37 +00:00
ROOT_URL: "https://{{ gitea_domain }}/"
SSH_DOMAIN: "{{ gitea_domain }}"
DOMAIN: "{{ gitea_domain }}"
2020-07-28 03:20:50 +00:00
labels:
traefik.http.routers.gitea.rule: "Host(`{{ gitea_domain }}`)"
traefik.http.routers.gitea.entrypoints: websecure
traefik.http.routers.gitea.tls.certresolver: letsencrypt
traefik.http.routers.gitea.middlewares: "securehttps@file"
2020-07-28 03:20:50 +00:00
traefik.http.services.gitea.loadbalancer.server.port: "3000"
traefik.docker.network: traefik
traefik.enable: "true"