Use host network for gitea container.

This commit is contained in:
yohan 2024-11-03 20:57:09 +01:00
parent 1697c11dc1
commit fbd8530fce
3 changed files with 8 additions and 6 deletions

View File

@ -4,4 +4,4 @@
# uses the hosts file from the container image or "none" which means
# no base hosts file is used. The default is "" which will use /etc/hosts.
base_hosts_file = "none"
#base_hosts_file = "none"

View File

@ -80,10 +80,7 @@
image: docker.io/gitea/gitea:1.22.3
state: present
network:
- reverse-proxy
- mysqlnet
ports:
- 2222:22/tcp
- host
volume:
- /mnt/volumes/gitea_data/data:/data:Z
env:
@ -94,7 +91,6 @@
GITEA__database__NAME: "gitea"
GITEA__database__USER: "gitea"
GITEA__database__PASSWD: "{{ gitea_db_password }}"
dns_search: "{{ SHORTNAME }}-sub.{{ DOMAIN }}"
generate_systemd:
path: /etc/systemd/system
become: true

View File

@ -98,3 +98,9 @@
state: restarted
become: true
when: create_mysql_container is changed
- name: Add mysql-server.{{ DOMAIN }} to /etc/hosts
ansible.builtin.lineinfile:
path: "/etc/hosts"
line: "127.0.0.1 mysql-server.{{ DOMAIN }} mysql-server"
become: true