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 register: user_gitea
when: '"gitea" in groups' 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 - name: Create docker-compose directory
ansible.builtin.file: ansible.builtin.file:
path: "{{ docker_compose_dir }}" path: "{{ docker_compose_dir }}"

View File

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

View File

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