gitea migration

This commit is contained in:
bee
2026-05-31 15:19:59 +02:00
parent 11b13cd326
commit c0ae209a9d
7 changed files with 191 additions and 24 deletions
+43
View File
@@ -0,0 +1,43 @@
networks:
gitea:
external: false
services:
server:
image: docker.gitea.com/gitea:1.26.0
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=db:5432
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD={{ gitea_db_password }}
- GITEA__server__SSH_LISTEN_PORT=2222
- GITEA__server__SSH_PORT=2222
- SSH_LISTEN_PORT=2222
restart: always
networks:
- gitea
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "2222:2222"
depends_on:
- db
db:
image: docker.io/library/postgres:14
restart: always
environment:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD={{ gitea_db_password }}
- POSTGRES_DB=gitea
networks:
- gitea
volumes:
- ./postgres:/var/lib/postgresql/data
+46
View File
@@ -0,0 +1,46 @@
- name: Gitea
hosts: beepi
become: true
vars:
gitea_db_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
63336533393735346165633965383866393736336365646330346236356239363737353234383637
6261383166323062663033346136633066303462343263320a333932646162336232373530373834
65386637336562646135613563356137313239336365653161386434313835633437613233343332
3736353865313938300a383266353538666135353866653263663133663232646430323966353134
3939
tasks:
- name: Install podman
ansible.builtin.apt:
name: podman
state: present
- name: Install podman-compose
ansible.builtin.apt:
name: podman-compose
state: present
- name: Create gitea directory
ansible.builtin.file:
path: /opt/beeserver/gitea
state: directory
mode: '0755'
- name: Compose down
changed_when: true
failed_when: false
ansible.builtin.command:
cmd: podman-compose down
chdir: /opt/beeserver/gitea
- name: Copy compose
ansible.builtin.template:
src: docker-compose.yml.j2
dest: /opt/beeserver/gitea/docker-compose.yml
mode: '0644'
- name: Compose up
changed_when: true
ansible.builtin.command:
cmd: podman-compose up -d
chdir: /opt/beeserver/gitea