2024-10-01 02:05:54 +05:00
|
|
|
---
|
2024-10-21 20:46:58 +05:00
|
|
|
- name: Create forgejo network
|
|
|
|
become: true
|
|
|
|
community.docker.docker_network:
|
|
|
|
name: forgejo
|
|
|
|
- name: Create redis container
|
|
|
|
include_role:
|
|
|
|
name: redis
|
|
|
|
vars:
|
|
|
|
preset: cache
|
|
|
|
container_name: redis-forgejo
|
|
|
|
docker_networks:
|
|
|
|
- name: forgejo
|
|
|
|
- name: Create forgejo volume
|
|
|
|
become: true
|
|
|
|
community.docker.docker_volume:
|
|
|
|
name: forgejo
|
|
|
|
- name: Copy app.ini
|
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: app.ini.j2
|
|
|
|
dest: /var/lib/docker/volumes/forgejo/_data/custom/conf/app.ini
|
|
|
|
owner: 1000
|
|
|
|
group: 1000
|
|
|
|
mode: '0660'
|
|
|
|
register: appini
|
|
|
|
- name: Create forgejo container
|
|
|
|
become: true
|
|
|
|
community.docker.docker_container:
|
|
|
|
name: forgejo
|
2024-11-11 15:09:10 +05:00
|
|
|
image: codeberg.org/forgejo/forgejo:{{ tag }}
|
2024-10-21 20:46:58 +05:00
|
|
|
env:
|
2024-11-11 15:09:10 +05:00
|
|
|
USER_UID: "{{ user_uid | string }}"
|
|
|
|
USER_GID: "{{ user_gid | string }}"
|
|
|
|
FORGEJO_WORK_DIR: "{{ work_path }}"
|
|
|
|
FORGEJO_CUSTOM: "{{ work_path }}/custom"
|
2024-10-21 20:46:58 +05:00
|
|
|
networks:
|
|
|
|
- name: postgresql
|
|
|
|
- name: forgejo
|
|
|
|
- name: minio
|
|
|
|
- name: haproxy
|
|
|
|
volumes:
|
|
|
|
- forgejo:/data
|
|
|
|
- /etc/timezone:/etc/timezone:ro
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
ports:
|
2024-11-11 15:09:10 +05:00
|
|
|
- "{{ ssh_listen_port }}:{{ ssh_listen_port }}"
|
2024-10-21 20:46:58 +05:00
|
|
|
recreate: "{{ appini.changed }}"
|
2024-10-30 17:55:20 +05:00
|
|
|
restart_policy: unless-stopped
|