roles/containers: make gitea bridge network instead of host network

This commit is contained in:
dogeystamp 2023-09-03 19:38:29 -04:00
parent 167c01c04e
commit ff40949ff7
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
3 changed files with 17 additions and 5 deletions

View File

@ -17,6 +17,19 @@
register: user_gitea
when: '"gitea" in groups'
- name: Create Syncthing group
group:
name: vault
state: present
when: '"syncthing" in groups'
- name: Create Syncthing user
user:
name: syncthing
group: vault
register: user_syncthing
when: '"syncthing" in groups'
- name: Create docker-compose directory
ansible.builtin.file:
path: "{{ docker_compose_dir }}"

View File

@ -6,18 +6,17 @@ version: "3"
services:
{% if "gitea" in group_names %}
gitea:
network_mode: host
container_name: gitea
image: gitea/gitea:latest
environment:
- USER=gitea
- USER_UID={{ user_gitea.uid }}
- USER_GID={{ user_gitea.group }}
- GITEA__server__SSH_PORT=2499
- GITEA__server__SSH_LISTEN_PORT=2499
- GITEA__service__DISABLE_REGISTRATION=true
- GITEA__server__DOMAIN={{ gitea_domain }}
- GITEA__server__SSH_DOMAIN={{ gitea_domain }}
ports:
- "3000:3000"
- "2499:22"
restart: unless-stopped
volumes:
- {{ dataroot }}/gitea:/data

View File

@ -1,5 +1,5 @@
[Match]
Name=*
Name={{ net_interface }}
[DHCP]
UseDNS=false