Add gitea role
Added base gitea docker setup role. Adds automatic unattended setup with default admin account and optional email notification setup.
This commit is contained in:
parent
12a3fa1e6f
commit
3a5b5680cf
10 changed files with 360 additions and 0 deletions
68
roles/gitea/templates/docker-stack.yml.j2
Normal file
68
roles/gitea/templates/docker-stack.yml.j2
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
version: '3.4'
|
||||
|
||||
services:
|
||||
app:
|
||||
image: "{{ stack_image }}:{{ gitea_version }}"
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "localhost:3000"]
|
||||
interval: 1m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 1m
|
||||
volumes:
|
||||
- data:/data
|
||||
- /home/git/.ssh:/data/git/.ssh
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- USER_UID={{ git_user['uid'] }}
|
||||
- USER_GID={{ git_user['group'] }}
|
||||
- GITEA__database__DB_TYPE=postgres
|
||||
- GITEA__database__HOST=db:5432
|
||||
- GITEA__database__NAME={{ gitea_db_database }}
|
||||
- GITEA__database__USER={{ gitea_db_username }}
|
||||
- GITEA__database__PASSWD={{ gitea_db_password }}
|
||||
- "GITEA__server__ROOT_URL={{ (gitea_use_https == True) | ternary('https', 'http') }}://{{ (subdomain_alias is not undefined and not none) | ternary(subdomain_alias, stack_name) }}.{{server_domain}}"
|
||||
- "GITEA__server__SSH_DOMAIN={{ server_domain }}"
|
||||
- GITEA__server__LANDINGPAGE=explore
|
||||
- GITEA__service__DISABLE_REGISTRATION=true
|
||||
{% if gitea_app_admin_username is not undefined and not None and gitea_app_admin_password is not undefined and not None %}
|
||||
- GITEA__security__INSTALL_LOCK=true
|
||||
{% endif %}
|
||||
{% if gitea_smtp_host is not undefined and not None and gitea_smtp_username is not undefined and not None and gitea_smtp_password is not undefined and not None %}
|
||||
- GITEA__mailer__ENABLED=true
|
||||
- GITEA__service__ENABLE_NOTIFY_MAIL=true
|
||||
- GITEA__mailer__FROM=gitea@{{ server_domain }}
|
||||
- GITEA__mailer__TYPE=smtp
|
||||
- GITEA__mailer__HOST={{ gitea_smtp_host }}
|
||||
- GITEA__mailer__IS_TLS_ENABLED={{ (gitea_smtp_force_tls is not undefined and not None) | ternary(gitea_smtp_force_tls,'false') }}
|
||||
- GITEA__mailer__USER={{ gitea_smtp_username }}
|
||||
- GITEA__mailer__PASSWD={{ gitea_smtp_password }}
|
||||
{% endif %}
|
||||
networks:
|
||||
- "{{ docker_swarm_public_network_name }}"
|
||||
- backend
|
||||
ports:
|
||||
- "127.0.0.1:2222:22"
|
||||
|
||||
db:
|
||||
image: postgres:13
|
||||
volumes:
|
||||
- db:/var/lib/postgresql/data
|
||||
networks:
|
||||
- backend
|
||||
environment:
|
||||
- POSTGRES_USER={{ gitea_db_username }}
|
||||
- POSTGRES_PASSWORD={{ gitea_db_password }}
|
||||
- POSTGRES_DB={{ gitea_db_database }}
|
||||
|
||||
volumes:
|
||||
data:
|
||||
db:
|
||||
|
||||
networks:
|
||||
"{{ docker_swarm_public_network_name }}":
|
||||
external: true
|
||||
backend:
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue