roles/containers: gitea should work properly now
This commit is contained in:
parent
dd0de3139e
commit
e8f762a4cb
@ -13,7 +13,7 @@ backup_disk: no
|
||||
|
||||
# where data goes
|
||||
# if you have external_disk on, you should probably set this to a path there
|
||||
dataroot: /var/www/data
|
||||
dataroot: /var/lib/serv_data
|
||||
|
||||
# send dynamic DNS update for this domain
|
||||
dyndns_domain: null
|
||||
|
@ -4,3 +4,5 @@
|
||||
# change these in group/host vars
|
||||
|
||||
docker_compose_dir: "/opt/services"
|
||||
|
||||
gitea_domain: "git.{{ domain }}"
|
||||
|
@ -22,22 +22,16 @@
|
||||
template:
|
||||
src: "docker-compose.yml.j2"
|
||||
dest: "{{ docker_compose_dir }}/docker-compose.yml"
|
||||
register: docker-comp
|
||||
register: generateComp
|
||||
|
||||
- name: Create systemd unit file
|
||||
template:
|
||||
src: "docker-compose.service.j2"
|
||||
dest: "/etc/systemd/system/docker-compose.service"
|
||||
|
||||
- name: Compose up
|
||||
- name: Compose up (update images if necessary)
|
||||
systemd:
|
||||
name: docker-compose
|
||||
state: "{{ 'restarted' if docker-comp.changed else 'started' }}"
|
||||
state: reloaded
|
||||
enabled: true
|
||||
|
||||
# for some reason port mappings don't work without this?
|
||||
- name: Restart docker for good measure
|
||||
systemd:
|
||||
name: docker
|
||||
state: restarted
|
||||
when: docker-comp.changed
|
||||
register: compUp
|
||||
|
@ -11,7 +11,7 @@ ExecStartPre=-/usr/bin/docker compose pull
|
||||
ExecStart=/usr/bin/docker compose up --remove-orphans
|
||||
ExecStop=/usr/bin/docker compose down
|
||||
ExecReload=/usr/bin/docker compose pull
|
||||
ExecReload=/usr/bin/docker compose up --remove-orphans
|
||||
ExecReload=/usr/bin/docker compose up --remove-orphans --detach
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -3,26 +3,23 @@
|
||||
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
services:
|
||||
{% if "gitea" in group_names %}
|
||||
gitea:
|
||||
network_mode: host
|
||||
container_name: gitea
|
||||
image: gitea/gitea:latest
|
||||
environment:
|
||||
- USER=gitea
|
||||
- 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 }}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- {{ dataroot }}/gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "2499:22"
|
||||
|
||||
{% endif %}
|
||||
|
@ -53,3 +53,8 @@
|
||||
name: cronie
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
- name: Create data root dir
|
||||
file:
|
||||
path: "{{ dataroot }}"
|
||||
state: directory
|
||||
|
Loading…
Reference in New Issue
Block a user