Add portfolio
This commit is contained in:
parent
1ea0ffc68c
commit
020008071b
4 changed files with 55 additions and 0 deletions
|
@ -21,4 +21,5 @@
|
|||
- { role: iptables, tags: ["iptables"] }
|
||||
- { role: borg, tags: ["borg"] }
|
||||
- { role: watchtower, tags: ["watchtower"] }
|
||||
- { role: portfolio, tags: ["portfolio"] }
|
||||
- { role: clean, tags: ["clean"] }
|
||||
|
|
22
roles/portfolio/tasks/base.yml
Normal file
22
roles/portfolio/tasks/base.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
|
||||
- name: Check portfolio directory exist
|
||||
ansible.builtin.file:
|
||||
path: portfolio
|
||||
state: directory
|
||||
|
||||
- name: Copy template conf
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "portfolio/{{ item.dest }}"
|
||||
loop:
|
||||
- { src: 'docker-compose.yml', dest: 'docker-compose.yml' }
|
||||
register: portfolio_copy_templates_results
|
||||
|
||||
- name: Update and restart container
|
||||
community.docker.docker_compose:
|
||||
project_src: portfolio
|
||||
state: present
|
||||
pull: true
|
||||
restarted: "{{ portfolio_copy_templates_results.changed }}"
|
||||
become: true
|
4
roles/portfolio/tasks/main.yml
Normal file
4
roles/portfolio/tasks/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
|
||||
- ansible.builtin.import_tasks: base.yml
|
||||
name: base
|
28
roles/portfolio/templates/docker-compose.yml
Normal file
28
roles/portfolio/templates/docker-compose.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
portfolio:
|
||||
image: gitea.mrdev023.fr/mrdev023/portfolio:latest
|
||||
container_name: portfolio
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.docker.network=proxy
|
||||
# HTTP Reverse proxy portfolio
|
||||
- traefik.http.routers.portfolio-secure.entrypoints=https
|
||||
- traefik.http.routers.portfolio-secure.rule=Host(`{{ server.domain }}`)
|
||||
- traefik.http.routers.portfolio-secure.tls=true
|
||||
- traefik.http.routers.portfolio-secure.tls.certresolver=sslResolver
|
||||
- traefik.http.routers.portfolio-secure.service=portfolio
|
||||
- traefik.http.services.portfolio.loadbalancer.server.port=8080
|
||||
logging:
|
||||
driver: loki
|
||||
options:
|
||||
loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push"
|
||||
mode: non-blocking
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
Loading…
Reference in a new issue