Refactor service deployment + upload Compose files to the server #178

Merged
samsapti merged 24 commits from compose-files into main 2023-12-09 18:38:11 +00:00
2 changed files with 46 additions and 21 deletions
Showing only changes of commit 728455f42a - Show all commits

View file

@ -1,23 +1,12 @@
# vim: ft=yaml.ansible # vim: ft=yaml.ansible
--- ---
- name: setup netdata docker container for system monitoring - name: Upload Compose file for Netdata
docker_container: template:
name: netdata src: compose-files/netdata.yml.j2
image: netdata/netdata:{{ services.netdata.version }} dest: "{{ services.netdata.volume_folder }}/docker-compose.yml"
restart_policy: unless-stopped
hostname: "hevonen.servers.{{ base_domain }}" - name: Deploy Netdata
capabilities: docker_compose:
- SYS_PTRACE project_src: "{{ services.netdata.volume_folder }}"
security_opts: pull: true
- apparmor:unconfined state: present
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- name: external_services
env:
VIRTUAL_HOST : "{{ services.netdata.domain }}"
LETSENCRYPT_HOST: "{{ services.netdata.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
PGID: "999"

View file

@ -0,0 +1,36 @@
# vim: ft=yaml.docker-compose
version: "3.8"
services:
app:
image: netdata/netdata:{{ services.netdata.version }}
restart: unless-stopped
hostname: hevonen.servers.{{ base_domain }}
volumes:
- "/proc:/host/proc:ro"
- "/sys:/host/sys:ro"
- "/etc/os-release:/host/etc/os-release:ro"
networks:
- default
- external_services
environment:
VIRTUAL_HOST : "{{ services.netdata.domain }}"
LETSENCRYPT_HOST: "{{ services.netdata.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
PGID: "999"
DOCKER_HOST: "socket_proxy:2375"
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
socket_proxy:
image: tecnativa/docker-socket-proxy:latest
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
environment:
CONTAINERS: 1
networks:
external_services:
external: true