Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f04ebac488 | ||
|
|
7a595cf984 | ||
|
|
4397f6aadd | ||
|
|
89354e5547 |
No files matched your search
@@ -1,47 +0,0 @@
|
||||
# Provision one Proxmox VM with Semaphore
|
||||
|
||||
Run `ansible/proxmox/provision_vm.yml` as a Semaphore Ansible task with inventory `localhost ansible_connection=local`. It clones one cloud-init template, configures the new VM before boot, then connects to the guest by FQDN.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- The template needs a bootable `scsi0`, a `scsi1` cloud-init drive, Python 3, `cloud-init`, `timeout`, SSH and network access. It does not need the QEMU guest agent enabled.
|
||||
- The guest needs `timedatectl`, `tzdata`, apt access and noninteractive sudo for `vm_user` to set its timezone and install/start the agent.
|
||||
- The Semaphore runner must trust the Proxmox CA and have a verified guest SSH host key in `known_hosts`. Do not disable TLS or SSH host-key verification. Confirm the DNS record belongs to the new VM before connecting; a stale record could point to another host.
|
||||
- Select an SSH Key Store **user credential on the task inventory** matching an authorized public key for `vm_user`. Check that the same invocation makes this credential available to the dynamically added guest in your installed Semaphore version. The Proxmox API token is separate.
|
||||
- The Semaphore image installs `proxmoxer>=2.3,<3` and `requests>=2.31,<3` from `docker/semaphore/requirements.txt` on startup (mounted at `/etc/semaphore/requirements.txt`). Semaphore installs `ansible/proxmox/requirements.yml` (`community.proxmox:2.0.0`) unless **Skip Galaxy install** is enabled.
|
||||
|
||||
## Semaphore variables
|
||||
|
||||
Put these fixed values in a Variable Group:
|
||||
|
||||
| Variable | Value |
|
||||
| --- | --- |
|
||||
| `proxmox_api_host` | Hostname, not a URL |
|
||||
| `vm_template_id`, `vm_storage`, `vm_user` | Template, destination storage and guest user |
|
||||
| `vm_ssh_public_key` | One or more complete public keys, separated by newlines; include the key matching the selected SSH credential |
|
||||
| `proxmox_api_port` | Optional; defaults to `8006` |
|
||||
| `vm_ipconfig0` | Optional; defaults to `ip=dhcp` |
|
||||
|
||||
Put `proxmox_api_token_id` (full `user@realm!token`) and `proxmox_api_token_secret` in the Variable Group's **Secrets** tab, not the survey.
|
||||
|
||||
Survey inputs:
|
||||
|
||||
| Variable | Default |
|
||||
| --- | --- |
|
||||
| `vm_hostname` | Required unique short DNS label (no dots) |
|
||||
| `vm_cpu` | `1` core |
|
||||
| `vm_ram_gib` | `2` GiB |
|
||||
| `vm_disk_gib` | `4` GiB, absolute disk size |
|
||||
| `vm_vlan` | `vlan66` bridge/VNet name |
|
||||
|
||||
Only `vlan66` maps to a DNS suffix (`lab.vezpi.com`); other VLANs fail before cloning. DHCP/DNS must publish `<hostname>.lab.vezpi.com` for that VNet.
|
||||
|
||||
## What happens
|
||||
|
||||
1. The playbook rejects an invalid or existing hostname, then finds the template's current node and clones it. It enables the clone's virtio guest-agent channel before first boot, regardless of template configuration.
|
||||
2. It waits for DNS, port 22, an Ansible connection and cloud-init. Cloud-init exit code `0` is accepted; degraded exit code `2` is accepted with a warning. Other codes, incomplete status and timeouts fail.
|
||||
3. On the guest it sets the display timezone to `Europe/Paris` (CET/CEST), installs `qemu-guest-agent` and starts its device-activated service. It does not change RTC/NTP, manually enable the static unit, configure sudo or reboot.
|
||||
|
||||
New clones use `vm_cpu_model` (default `x86-64-v2-AES`, overridable via extra vars) before first boot; every destination host must support the selected model. Existing VMs and templates are unchanged.
|
||||
|
||||
A failure leaves the new VM intact for inspection. Playbook success does **not** prove agent communication: on the VM's actual Proxmox node, run `qm agent <NEW_VMID> ping`. A successful exit with no error is sufficient, even if the response is empty.
|
||||
@@ -82,7 +82,7 @@
|
||||
qm create {{ template_vmid }}
|
||||
--memory {{ template_memory }}
|
||||
--core {{ template_cores }}
|
||||
--net0 virtio,bridge=vlan66
|
||||
--net0 virtio,bridge=vmbr0
|
||||
--scsihw virtio-scsi-pci
|
||||
--bios ovmf
|
||||
--machine q35
|
||||
@@ -98,6 +98,9 @@
|
||||
- name: Set boot order to the primary disk
|
||||
ansible.builtin.command: qm set {{ template_vmid }} --boot order=scsi0
|
||||
|
||||
- name: Add serial console for cloud-init consoles
|
||||
ansible.builtin.command: qm set {{ template_vmid }} --serial0 socket --vga serial0
|
||||
|
||||
- name: Convert the VM to a template
|
||||
ansible.builtin.command: qm template {{ template_vmid }}
|
||||
|
||||
|
||||
@@ -1,192 +0,0 @@
|
||||
---
|
||||
- name: Clone and start one cloud-init VM
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: false
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ ansible_playbook_python }}"
|
||||
vm_cpu: 1
|
||||
vm_cpu_model: x86-64-v2-AES
|
||||
vm_ram_gib: 2
|
||||
vm_disk_gib: 4
|
||||
vm_vlan: vlan66
|
||||
vm_ipconfig0: ip=dhcp
|
||||
vm_dns_domains:
|
||||
vlan66: lab.vezpi.com
|
||||
module_defaults:
|
||||
group/community.proxmox.proxmox:
|
||||
api_host: "{{ proxmox_api_host }}"
|
||||
api_port: "{{ proxmox_api_port | default(8006) }}"
|
||||
api_user: "{{ proxmox_api_token_id.split('!')[0] }}"
|
||||
api_token_id: "{{ proxmox_api_token_id.split('!')[1] }}"
|
||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||
validate_certs: true
|
||||
tasks:
|
||||
- name: Validate hostname and DNS mapping before using the API
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- vm_hostname is defined and vm_hostname is match('^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$')
|
||||
- vm_vlan in vm_dns_domains
|
||||
fail_msg: A short hostname and a known VLAN/DNS suffix are required; no VM was created.
|
||||
|
||||
- name: Look up requested hostname across the cluster
|
||||
community.proxmox.proxmox_vm_info:
|
||||
name: "{{ vm_hostname }}"
|
||||
register: named_vm
|
||||
no_log: true
|
||||
|
||||
- name: Reject an already used hostname
|
||||
ansible.builtin.assert:
|
||||
that: named_vm.proxmox_vms | length == 0
|
||||
fail_msg: "Hostname {{ vm_hostname }} already exists; no VM was modified. Inspect it before retrying."
|
||||
|
||||
- name: Look up source template and its current configuration
|
||||
community.proxmox.proxmox_vm_info:
|
||||
vmid: "{{ vm_template_id }}"
|
||||
type: qemu
|
||||
config: current
|
||||
register: source_vm
|
||||
no_log: true
|
||||
|
||||
- name: Require a cloud-init-ready template on its current node
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- source_vm.proxmox_vms | length == 1
|
||||
- source_vm.proxmox_vms[0].node is defined
|
||||
- source_vm.proxmox_vms[0].template | bool
|
||||
- source_vm.proxmox_vms[0].config.scsi0 is defined
|
||||
- source_vm.proxmox_vms[0].config.scsi1 is defined
|
||||
- "'cloudinit' in source_vm.proxmox_vms[0].config.scsi1"
|
||||
fail_msg: "Template {{ vm_template_id }} must resolve uniquely to a QEMU template with a node, scsi0 and a scsi1 cloud-init drive; no VM was created."
|
||||
|
||||
- name: Clone template into a new VM
|
||||
community.proxmox.proxmox_kvm:
|
||||
clone: source-template
|
||||
vmid: "{{ vm_template_id }}"
|
||||
name: "{{ vm_hostname }}"
|
||||
node: "{{ source_vm.proxmox_vms[0].node }}"
|
||||
storage: "{{ vm_storage }}"
|
||||
full: true
|
||||
state: present
|
||||
register: cloned_vm
|
||||
no_log: true
|
||||
|
||||
- name: Stop if cloning did not allocate a new VMID
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- cloned_vm.changed
|
||||
- cloned_vm.vmid is defined
|
||||
- cloned_vm.vmid | int != vm_template_id | int
|
||||
fail_msg: >-
|
||||
Clone did not return a valid new VMID (possibly allocated concurrently);
|
||||
no configuration was attempted. Inspect the cluster before retrying.
|
||||
|
||||
- name: Configure VM before first boot
|
||||
community.proxmox.proxmox_kvm:
|
||||
vmid: "{{ cloned_vm.vmid }}"
|
||||
node: "{{ source_vm.proxmox_vms[0].node }}"
|
||||
update: true
|
||||
update_unsafe: true # Needed to replace net0 on this newly cloned VM.
|
||||
cores: "{{ vm_cpu }}"
|
||||
cpu: "{{ vm_cpu_model }}"
|
||||
memory: "{{ vm_ram_gib | int * 1024 }}"
|
||||
net:
|
||||
net0: "virtio,bridge={{ vm_vlan }}"
|
||||
ipconfig:
|
||||
ipconfig0: "{{ vm_ipconfig0 }}"
|
||||
ciuser: "{{ vm_user }}"
|
||||
sshkeys: "{{ vm_ssh_public_key }}"
|
||||
agent: "enabled=1,type=virtio"
|
||||
state: present
|
||||
no_log: true
|
||||
|
||||
- name: Resize VM disk to requested size
|
||||
community.proxmox.proxmox_disk:
|
||||
vmid: "{{ cloned_vm.vmid }}"
|
||||
disk: scsi0
|
||||
size: "{{ vm_disk_gib }}G"
|
||||
state: resized
|
||||
no_log: true
|
||||
|
||||
- name: Start VM
|
||||
community.proxmox.proxmox_kvm:
|
||||
vmid: "{{ cloned_vm.vmid }}"
|
||||
state: started
|
||||
no_log: true
|
||||
|
||||
- name: Wait for guest DNS publication
|
||||
ansible.builtin.command: getent ahosts "{{ vm_hostname }}.{{ vm_dns_domains[vm_vlan] }}"
|
||||
register: guest_dns
|
||||
changed_when: false
|
||||
until: guest_dns.rc == 0 and guest_dns.stdout | length > 0
|
||||
retries: 20
|
||||
delay: 15
|
||||
|
||||
- name: Wait for guest SSH port
|
||||
ansible.builtin.wait_for:
|
||||
host: "{{ vm_hostname }}.{{ vm_dns_domains[vm_vlan] }}"
|
||||
port: 22
|
||||
connect_timeout: 5
|
||||
timeout: 180
|
||||
sleep: 5
|
||||
|
||||
- name: Add VM to dynamic inventory
|
||||
ansible.builtin.add_host:
|
||||
name: "{{ vm_hostname }}.{{ vm_dns_domains[vm_vlan] }}"
|
||||
groups: provisioned_vm
|
||||
ansible_connection: ssh
|
||||
ansible_user: "{{ vm_user }}"
|
||||
ansible_ssh_timeout: 10
|
||||
provisioned_vmid: "{{ cloned_vm.vmid }}"
|
||||
|
||||
- name: Verify cloud-init and Ansible on the new guest
|
||||
hosts: provisioned_vm
|
||||
gather_facts: false
|
||||
vars:
|
||||
vm_timezone: Europe/Paris
|
||||
tasks:
|
||||
- name: Wait for guest to be available
|
||||
ansible.builtin.wait_for_connection:
|
||||
connect_timeout: 10
|
||||
sleep: 5
|
||||
timeout: 180
|
||||
|
||||
- name: Wait for cloud-init status
|
||||
ansible.builtin.command: timeout 300 cloud-init status --wait --long
|
||||
register: cloudinit_wait
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Show cloud-init wait diagnostics
|
||||
ansible.builtin.debug:
|
||||
msg:
|
||||
- "stdout: {{ cloudinit_wait.stdout | trim }}"
|
||||
- "stderr: {{ cloudinit_wait.stderr | trim }}"
|
||||
when: cloudinit_wait.rc == 2
|
||||
|
||||
- name: Assert cloud-init completion
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- cloudinit_wait.rc in [0, 2]
|
||||
- "cloudinit_wait.stdout is search('(?m)^status: done\\s*$')"
|
||||
fail_msg: "VMID {{ provisioned_vmid }} cloud-init status is not complete (rc {{ cloudinit_wait.rc }}); VM left intact for inspection."
|
||||
|
||||
- name: Set guest timezone
|
||||
ansible.builtin.command: timedatectl set-timezone "{{ vm_timezone }}"
|
||||
become: true
|
||||
|
||||
- name: Install QEMU guest agent
|
||||
ansible.builtin.apt:
|
||||
name: qemu-guest-agent
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Start QEMU guest agent
|
||||
ansible.builtin.service:
|
||||
name: qemu-guest-agent
|
||||
state: started
|
||||
become: true
|
||||
|
||||
- name: Report verified guest readiness
|
||||
ansible.builtin.debug:
|
||||
msg: "VMID {{ provisioned_vmid }} at {{ inventory_hostname }} completed cloud-init."
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
collections:
|
||||
- name: community.proxmox
|
||||
version: "2.0.0"
|
||||
@@ -1,11 +0,0 @@
|
||||
# Local Compose inputs and generated private material must not be published.
|
||||
.env
|
||||
.env.*
|
||||
# Named Compose env inputs (for example, homeassistant/*.env).
|
||||
*.env
|
||||
!.env.example
|
||||
!.env.sample
|
||||
!.env.template
|
||||
acme.json
|
||||
*.key
|
||||
*.pem
|
||||
@@ -1,84 +0,0 @@
|
||||
services:
|
||||
blog_production:
|
||||
image: vezpi-blog:latest
|
||||
container_name: blog_production
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- URL=${URL_PROD}
|
||||
- BRANCH=main
|
||||
volumes:
|
||||
- blog_production_hugo_resources:/hugo-resources
|
||||
networks:
|
||||
- web
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost/ > /dev/null || exit 1"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
start_period: 5s
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.blog.rule=Host(`${URL_PROD}`)
|
||||
- traefik.http.routers.blog.entrypoints=https
|
||||
- traefik.http.routers.blog.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.blog.loadbalancer.server.port=80
|
||||
restart: always
|
||||
|
||||
blog_staging:
|
||||
image: vezpi-blog:latest
|
||||
container_name: blog_staging
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- URL=${URL_STAGING}
|
||||
- BRANCH=preview
|
||||
volumes:
|
||||
- blog_staging_hugo_resources:/hugo-resources
|
||||
networks:
|
||||
- web
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost/ > /dev/null || exit 1"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
start_period: 5s
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.blog-staging.rule=Host(`${URL_STAGING}`)
|
||||
- traefik.http.routers.blog-staging.entrypoints=https
|
||||
- traefik.http.routers.blog-staging.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.blog-staging.loadbalancer.server.port=80
|
||||
restart: always
|
||||
|
||||
blog_dev:
|
||||
image: vezpi-blog:dev
|
||||
container_name: blog_dev
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- URL=${URL_DEV}
|
||||
- BRANCH=${BLOG_TEST_BRANCH:-preview}
|
||||
volumes:
|
||||
- blog_dev_hugo_resources:/hugo-resources
|
||||
networks:
|
||||
- web
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost/ > /dev/null || exit 1"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
start_period: 5s
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.blog-dev.rule=Host(`${URL_DEV}`)
|
||||
- traefik.http.routers.blog-dev.entrypoints=https
|
||||
- traefik.http.routers.blog-dev.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.blog-dev.loadbalancer.server.port=80
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
blog_production_hugo_resources:
|
||||
blog_staging_hugo_resources:
|
||||
blog_dev_hugo_resources:
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,21 +0,0 @@
|
||||
services:
|
||||
NAME:
|
||||
image: IMAGE
|
||||
container_name: NAME
|
||||
volumes:
|
||||
- /appli/data/NAME/:/
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.NAME.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.NAME.entrypoints=https
|
||||
- traefik.http.routers.NAME.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.NAME.loadbalancer.server.port=PORT
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,25 +0,0 @@
|
||||
services:
|
||||
duplicati:
|
||||
image: duplicati/duplicati
|
||||
container_name: duplicati
|
||||
volumes:
|
||||
- /appli/data/duplicati/data:/data
|
||||
- /backups:/backups
|
||||
- /restore:/restore
|
||||
- /:/source:ro
|
||||
hostname: ${URL}
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.duplicati.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.duplicati.entrypoints=https
|
||||
- traefik.http.routers.duplicati.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.duplicati.loadbalancer.server.port=8200
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,78 +0,0 @@
|
||||
services:
|
||||
server:
|
||||
image: gitea/gitea:28
|
||||
container_name: gitea_server
|
||||
restart: always
|
||||
volumes:
|
||||
- /appli/data/gitea/data:/data
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
- TZ=Europe/Paris
|
||||
- DB_TYPE=postgres
|
||||
- DB_HOST=db:5432
|
||||
- DB_NAME=${DB_NAME}
|
||||
- DB_USER=${DB_USER}
|
||||
- DB_PASSWD=${DB_PASSWD}
|
||||
- GITEA__service__DISABLE_REGISTRATION=true
|
||||
networks:
|
||||
- web
|
||||
- backend
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.gitea.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.gitea.entrypoints=https
|
||||
- traefik.http.routers.gitea.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.gitea.loadbalancer.server.port=3000
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: postgres:12-alpine
|
||||
container_name: gitea_db
|
||||
volumes:
|
||||
- /appli/data/gitea/db:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_USER=${DB_USER}
|
||||
- POSTGRES_PASSWORD=${DB_PASSWD}
|
||||
- POSTGRES_DB=${DB_NAME}
|
||||
networks:
|
||||
- backend
|
||||
restart: always
|
||||
|
||||
# webhook:
|
||||
# image: almir/webhook
|
||||
# container_name: gitea_webhook
|
||||
# command: -verbose -hooks=/etc/webhook/hooks.yaml -hotreload
|
||||
# volumes:
|
||||
# - /appli/data/gitea/webhook/hooks:/etc/webhook
|
||||
# - /appli/data/gitea/webhook/scripts:/scripts
|
||||
# environment:
|
||||
# - TZ=Europe/Paris
|
||||
# networks:
|
||||
# - backend
|
||||
# restart: always
|
||||
|
||||
runner:
|
||||
image: gitea/act_runner:latest
|
||||
container_name: gitea_runner
|
||||
restart: always
|
||||
environment:
|
||||
- GITEA_INSTANCE_URL=https://${URL}
|
||||
- GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_REGISTRATION_TOKEN}
|
||||
- GITEA_RUNNER_NAME=${GITEA_RUNNER_NAME}
|
||||
- GITEA_RUNNER_LABELS=${GITEA_RUNNER_LABELS}
|
||||
- CONFIG_FILE=/data/config.yml
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /appli/data/gitea/runner:/data
|
||||
- /appli:/appli
|
||||
networks:
|
||||
- backend
|
||||
depends_on:
|
||||
- server
|
||||
|
||||
networks:
|
||||
backend:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,197 +0,0 @@
|
||||
services:
|
||||
homeassistant:
|
||||
image: homeassistant/home-assistant:2026.10
|
||||
container_name: homeassistant_core
|
||||
hostname: homeassistant_core
|
||||
volumes:
|
||||
- /appli/data/homeassistant/core/:/config
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
networks:
|
||||
- lan
|
||||
- web
|
||||
- backend
|
||||
depends_on:
|
||||
- postgres
|
||||
- influxdb
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.homeassistant.rule=Host(`${URL_HASS}`)
|
||||
- traefik.http.routers.homeassistant.entrypoints=https
|
||||
- traefik.http.routers.homeassistant.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.homeassistant.loadbalancer.server.port=8123
|
||||
restart: unless-stopped
|
||||
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: homeassistant_postgres
|
||||
volumes:
|
||||
- /appli/data/homeassistant/postgres:/var/lib/postgresql/data
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
influxdb:
|
||||
image: influxdb:2-alpine
|
||||
container_name: homeassistant_influxdb
|
||||
volumes:
|
||||
- /appli/data/homeassistant/influxdb/data:/var/lib/influxdb2
|
||||
- /appli/data/homeassistant/influxdb/config/:/etc/influxdb2
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
ulimits:
|
||||
nofile:
|
||||
soft: 65536
|
||||
hard: 65536
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.homeassistant-influxdb.rule=Host(`${URL_INFLUXDB}`)
|
||||
- traefik.http.routers.homeassistant-influxdb.entrypoints=https
|
||||
- traefik.http.routers.homeassistant-influxdb.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.homeassistant-influxdb.middlewares=local-only@file
|
||||
- traefik.http.services.homeassistant-influxdb.loadbalancer.server.port=8086
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
restart: unless-stopped
|
||||
|
||||
# grafana:
|
||||
# image: grafana/grafana
|
||||
# container_name: homeassistant_grafana
|
||||
# depends_on:
|
||||
# - influxdb
|
||||
|
||||
mosquitto:
|
||||
image: eclipse-mosquitto
|
||||
container_name: homeassistant_mqtt
|
||||
volumes:
|
||||
- /appli/data/homeassistant/mosquitto/config:/mosquitto/config
|
||||
- /appli/data/homeassistant/mosquitto/data:/mosquitto/data
|
||||
- /appli/data/homeassistant/mosquitto/log:/mosquitto/log
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
zigbee2mqtt:
|
||||
image: koenkk/zigbee2mqtt
|
||||
container_name: homeassistant_zigbee
|
||||
volumes:
|
||||
- /appli/data/homeassistant/zigbee2mqtt:/app/data
|
||||
- /run/udev:/run/udev:ro
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
#devices:
|
||||
#- /dev/ttyUSB0:/dev/ttyACM0
|
||||
networks:
|
||||
- lan
|
||||
- backend
|
||||
- web
|
||||
depends_on:
|
||||
- mosquitto
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.homeassistant-zigbee2mqtt.rule=Host(`${URL_Z2M}`)
|
||||
- traefik.http.routers.homeassistant-zigbee2mqtt.entrypoints=https
|
||||
- traefik.http.routers.homeassistant-zigbee2mqtt.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.homeassistant-zigbee2mqtt.middlewares=local-only@file
|
||||
- traefik.http.services.homeassistant-zigbee2mqtt.loadbalancer.server.port=8080
|
||||
restart: always
|
||||
|
||||
editor:
|
||||
image: causticlab/hass-configurator-docker
|
||||
container_name: homeassistant_editor
|
||||
volumes:
|
||||
- /appli/data/homeassistant/editor:/config
|
||||
- /appli/data/homeassistant/core:/homeassistant_root
|
||||
- /appli/docker/homeassistant/docker-compose.yml:/homeassistant_root/docker-compose.yml
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.homeassistant-editor.rule=Host(`${URL_EDITOR}`)
|
||||
- traefik.http.routers.homeassistant-editor.entrypoints=https
|
||||
- traefik.http.routers.homeassistant-editor.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.homeassistant-editor.middlewares=local-only@file
|
||||
- traefik.http.services.homeassistant-editor.loadbalancer.server.port=3218
|
||||
restart: unless-stopped
|
||||
|
||||
# mdns:
|
||||
# image: monstrenyatko/mdns-repeater
|
||||
# container_name: homeassistant_mdns
|
||||
# command: mdns-repeater-app -f -d enp51s0 br-9388867fe123
|
||||
#restart: unless-stopped
|
||||
#network_mode: host
|
||||
|
||||
nodered:
|
||||
image: nodered/node-red
|
||||
container_name: homeassistant_nodered
|
||||
volumes:
|
||||
- /appli/data/homeassistant/nodered/data:/data
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
depends_on:
|
||||
- homeassistant
|
||||
- mosquitto
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.homeassistant-nodered.rule=Host(`${URL_NODERED}`)
|
||||
- traefik.http.routers.homeassistant-nodered.entrypoints=https
|
||||
- traefik.http.routers.homeassistant-nodered.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.homeassistant-nodered.middlewares=local-only@file
|
||||
- traefik.http.services.homeassistant-nodered.loadbalancer.server.port=1880
|
||||
restart: unless-stopped
|
||||
|
||||
whisper:
|
||||
image: rhasspy/wyoming-whisper
|
||||
container_name: homeassistant_whisper
|
||||
command: --model base-int8 --language fr
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
- /appli/data/homeassistant/whisper/data:/data
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
piper:
|
||||
image: rhasspy/wyoming-piper
|
||||
container_name: homeassistant_piper
|
||||
command: --voice fr_FR-mls-medium
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
- /appli/data/homeassistant/piper/data:/data
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
# ollama:
|
||||
# image: ollama/ollama
|
||||
# container_name: homeassistant_ollama
|
||||
# environment:
|
||||
# - TZ=Europe/Paris
|
||||
# volumes:
|
||||
# - /appli/data/homeassistant/ollama/data:/root/.ollama
|
||||
# networks:
|
||||
# - backend
|
||||
# restart: unless-stopped
|
||||
|
||||
networks:
|
||||
backend:
|
||||
lan:
|
||||
external: true
|
||||
web:
|
||||
external: true
|
||||
@@ -1,93 +0,0 @@
|
||||
#
|
||||
# WARNING: Make sure to use the docker-compose.yml of the current release:
|
||||
#
|
||||
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
|
||||
#
|
||||
# The compose file on main may not be compatible with the latest release.
|
||||
#
|
||||
|
||||
name: immich
|
||||
|
||||
services:
|
||||
server:
|
||||
container_name: immich_server
|
||||
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
|
||||
extends:
|
||||
file: hwaccel.transcoding.yml
|
||||
service: vaapi # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
|
||||
volumes:
|
||||
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
|
||||
- ${UPLOAD_LOCATION}:/usr/src/app/upload
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- redis
|
||||
- database
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.immich.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.immich.entrypoints=https
|
||||
- traefik.http.routers.immich.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.immich.loadbalancer.server.port=2283
|
||||
restart: always
|
||||
healthcheck:
|
||||
disable: false
|
||||
|
||||
machine-learning:
|
||||
container_name: immich-machine-learning
|
||||
# For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
|
||||
# Example tag: ${IMMICH_VERSION:-release}-cuda
|
||||
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
|
||||
#extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
|
||||
# file: hwaccel.ml.yml
|
||||
# service: openvino # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
|
||||
volumes:
|
||||
- model-cache:/cache
|
||||
networks:
|
||||
- backend
|
||||
env_file:
|
||||
- .env
|
||||
restart: always
|
||||
healthcheck:
|
||||
disable: false
|
||||
|
||||
redis:
|
||||
container_name: immich_redis
|
||||
image: docker.io/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5
|
||||
env_file:
|
||||
- .env
|
||||
networks:
|
||||
- backend
|
||||
healthcheck:
|
||||
test: redis-cli ping || exit 1
|
||||
restart: always
|
||||
|
||||
database:
|
||||
container_name: immich_database
|
||||
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_USER: ${DB_USERNAME}
|
||||
POSTGRES_DB: ${DB_DATABASE_NAME}
|
||||
POSTGRES_INITDB_ARGS: '--data-checksums'
|
||||
volumes:
|
||||
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
|
||||
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
||||
env_file:
|
||||
- .env
|
||||
networks:
|
||||
- backend
|
||||
shm_size: 128mb
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
model-cache:
|
||||
|
||||
networks:
|
||||
backend:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,43 +0,0 @@
|
||||
# Configurations for hardware-accelerated machine learning
|
||||
|
||||
# If using Unraid or another platform that doesn't allow multiple Compose files,
|
||||
# you can inline the config for a backend by copying its contents
|
||||
# into the immich-machine-learning service in the docker-compose.yml file.
|
||||
|
||||
# See https://immich.app/docs/features/ml-hardware-acceleration for info on usage.
|
||||
|
||||
services:
|
||||
armnn:
|
||||
devices:
|
||||
- /dev/mali0:/dev/mali0
|
||||
volumes:
|
||||
- /lib/firmware/mali_csffw.bin:/lib/firmware/mali_csffw.bin:ro # Mali firmware for your chipset (not always required depending on the driver)
|
||||
- /usr/lib/libmali.so:/usr/lib/libmali.so:ro # Mali driver for your chipset (always required)
|
||||
|
||||
cpu: {}
|
||||
|
||||
cuda:
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: 1
|
||||
capabilities:
|
||||
- gpu
|
||||
|
||||
openvino:
|
||||
device_cgroup_rules:
|
||||
- 'c 189:* rmw'
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
volumes:
|
||||
- /dev/bus/usb:/dev/bus/usb
|
||||
|
||||
openvino-wsl:
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
- /dev/dxg:/dev/dxg
|
||||
volumes:
|
||||
- /dev/bus/usb:/dev/bus/usb
|
||||
- /usr/lib/wsl:/usr/lib/wsl
|
||||
@@ -1,54 +0,0 @@
|
||||
# Configurations for hardware-accelerated transcoding
|
||||
|
||||
# If using Unraid or another platform that doesn't allow multiple Compose files,
|
||||
# you can inline the config for a backend by copying its contents
|
||||
# into the immich-microservices service in the docker-compose.yml file.
|
||||
|
||||
# See https://immich.app/docs/features/hardware-transcoding for more info on using hardware transcoding.
|
||||
|
||||
services:
|
||||
cpu: {}
|
||||
|
||||
nvenc:
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: 1
|
||||
capabilities:
|
||||
- gpu
|
||||
- compute
|
||||
- video
|
||||
|
||||
quicksync:
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
|
||||
rkmpp:
|
||||
security_opt: # enables full access to /sys and /proc, still far better than privileged: true
|
||||
- systempaths=unconfined
|
||||
- apparmor=unconfined
|
||||
group_add:
|
||||
- video
|
||||
devices:
|
||||
- /dev/rga:/dev/rga
|
||||
- /dev/dri:/dev/dri
|
||||
- /dev/dma_heap:/dev/dma_heap
|
||||
- /dev/mpp_service:/dev/mpp_service
|
||||
#- /dev/mali0:/dev/mali0 # only required to enable OpenCL-accelerated HDR -> SDR tonemapping
|
||||
volumes:
|
||||
#- /etc/OpenCL:/etc/OpenCL:ro # only required to enable OpenCL-accelerated HDR -> SDR tonemapping
|
||||
#- /usr/lib/aarch64-linux-gnu/libmali.so.1:/usr/lib/aarch64-linux-gnu/libmali.so.1:ro # only required to enable OpenCL-accelerated HDR -> SDR tonemapping
|
||||
|
||||
vaapi:
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
|
||||
vaapi-wsl: # use this for VAAPI if you're running Immich in WSL2
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
volumes:
|
||||
- /usr/lib/wsl:/usr/lib/wsl
|
||||
environment:
|
||||
- LIBVA_DRIVER_NAME=d3d12
|
||||
@@ -1,27 +0,0 @@
|
||||
services:
|
||||
jellyfin:
|
||||
image: linuxserver/jellyfin
|
||||
container_name: jellyfin
|
||||
volumes:
|
||||
- /appli/data/jellyfin/:/config
|
||||
- /data/videos/Series:/data/tvshows
|
||||
- /data/videos/Films:/data/movies
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- PUID=3120
|
||||
- PGID=3120
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.jellyfin.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.jellyfin.entrypoints=https
|
||||
- traefik.http.routers.jellyfin.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.jellyfin.loadbalancer.server.port=8096
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,95 +0,0 @@
|
||||
services:
|
||||
db:
|
||||
image: mariadb:lts
|
||||
container_name: nextcloud_db
|
||||
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
||||
volumes:
|
||||
- /appli/data/nextcloud/db:/var/lib/mysql
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||
- MYSQL_USER=${MYSQL_USER}
|
||||
- MARIADB_AUTO_UPGRADE=1
|
||||
networks:
|
||||
- backend
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
container_name: nextcloud_redis
|
||||
networks:
|
||||
- backend
|
||||
restart: always
|
||||
|
||||
core:
|
||||
image: nextcloud:35-fpm-alpine
|
||||
container_name: nextcloud_core
|
||||
volumes:
|
||||
- /appli/data/nextcloud/data:/var/www/html
|
||||
- /data/cloud/Documents:/mnt/data/Documents
|
||||
- /data/cloud/Ebook:/mnt/data/Ebook
|
||||
- /data/photo:/mnt/data/photo
|
||||
- /data/video:/mnt/data/video
|
||||
- /data/download:/mnt/data/download
|
||||
environment:
|
||||
- MYSQL_HOST=db
|
||||
- REDIS_HOST=redis
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||
- MYSQL_USER=${MYSQL_USER}
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
networks:
|
||||
- backend
|
||||
restart: always
|
||||
|
||||
web:
|
||||
build: ./web
|
||||
container_name: nextcloud_web
|
||||
volumes:
|
||||
- /appli/data/nextcloud/data:/var/www/html:ro
|
||||
depends_on:
|
||||
- core
|
||||
networks:
|
||||
- web
|
||||
- backend
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.nextcloud.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.nextcloud.entrypoints=https
|
||||
- traefik.http.routers.nextcloud.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.nextcloud.loadbalancer.server.port=80
|
||||
- traefik.http.middlewares.nextcloud.redirectregex.regex=/.well-known/(card|cal)dav
|
||||
- traefik.http.middlewares.nextcloud.redirectregex.replacement=/remote.php/dav/
|
||||
restart: always
|
||||
|
||||
cron:
|
||||
image: nextcloud:35-fpm-alpine
|
||||
container_name: nextcloud_cron
|
||||
volumes:
|
||||
- /appli/data/nextcloud/data:/var/www/html
|
||||
- /data/cloud/Documents:/mnt/data/Documents
|
||||
- /data/cloud/Ebook:/mnt/data/Ebook
|
||||
- /data/photo:/mnt/data/photo
|
||||
- /data/video:/mnt/data/video
|
||||
- /data/download:/mnt/data/download
|
||||
environment:
|
||||
- MYSQL_HOST=db
|
||||
- REDIS_HOST=redis
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||
- MYSQL_USER=${MYSQL_USER}
|
||||
entrypoint: /cron.sh
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
networks:
|
||||
- backend
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
backend:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,3 +0,0 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
@@ -1,170 +0,0 @@
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
upstream php-handler {
|
||||
server core:9000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
# HSTS settings
|
||||
# WARNING: Only add the preload option once you read about
|
||||
# the consequences in https://hstspreload.org/. This option
|
||||
# will add the domain to a hardcoded list that is shipped
|
||||
# in all major browsers and getting removed from this list
|
||||
# could take several months.
|
||||
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||
|
||||
# set max upload size
|
||||
client_max_body_size 512M;
|
||||
fastcgi_buffers 64 4K;
|
||||
|
||||
# Enable gzip but do not remove ETag headers
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_comp_level 4;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
|
||||
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
|
||||
|
||||
# Pagespeed is not supported by Nextcloud, so if your server is built
|
||||
# with the `ngx_pagespeed` module, uncomment this line to disable it.
|
||||
#pagespeed off;
|
||||
|
||||
# HTTP response headers borrowed from Nextcloud `.htaccess`
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Download-Options "noopen" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||
add_header X-Robots-Tag "none" always;
|
||||
|
||||
# Remove X-Powered-By, which is an information leak
|
||||
fastcgi_hide_header X-Powered-By;
|
||||
|
||||
# Path to the root of your installation
|
||||
root /var/www/html;
|
||||
|
||||
# Specify how to handle directories -- specifying `/index.php$request_uri`
|
||||
# here as the fallback means that Nginx always exhibits the desired behaviour
|
||||
# when a client requests a path that corresponds to a directory that exists
|
||||
# on the server. In particular, if that directory contains an index.php file,
|
||||
# that file is correctly served; if it doesn't, then the request is passed to
|
||||
# the front-end controller. This consistent behaviour means that we don't need
|
||||
# to specify custom rules for certain paths (e.g. images and other assets,
|
||||
# `/updater`, `/ocm-provider`, `/ocs-provider`), and thus
|
||||
# `try_files $uri $uri/ /index.php$request_uri`
|
||||
# always provides the desired behaviour.
|
||||
index index.php index.html /index.php$request_uri;
|
||||
|
||||
# Rule borrowed from `.htaccess` to handle Microsoft DAV clients
|
||||
location = / {
|
||||
if ( $http_user_agent ~ ^DavClnt ) {
|
||||
return 302 /remote.php/webdav/$is_args$args;
|
||||
}
|
||||
}
|
||||
|
||||
location = /robots.txt {
|
||||
allow all;
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# Make a regex exception for `/.well-known` so that clients can still
|
||||
# access it despite the existence of the regex rule
|
||||
# `location ~ /(\.|autotest|...)` which would otherwise handle requests
|
||||
# for `/.well-known`.
|
||||
location ^~ /.well-known {
|
||||
# The rules in this block are an adaptation of the rules
|
||||
# in `.htaccess` that concern `/.well-known`.
|
||||
|
||||
location = /.well-known/carddav { return 301 /remote.php/dav/; }
|
||||
location = /.well-known/caldav { return 301 /remote.php/dav/; }
|
||||
|
||||
location /.well-known/acme-challenge { try_files $uri $uri/ =404; }
|
||||
location /.well-known/pki-validation { try_files $uri $uri/ =404; }
|
||||
|
||||
# Let Nextcloud's API for `/.well-known` URIs handle all other
|
||||
# requests by passing them to the front-end controller.
|
||||
return 301 /index.php$request_uri;
|
||||
}
|
||||
|
||||
# Rules borrowed from `.htaccess` to hide certain paths from clients
|
||||
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; }
|
||||
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; }
|
||||
|
||||
# Ensure this block, which passes PHP files to the PHP process, is above the blocks
|
||||
# which handle static assets (as seen below). If this block is not declared first,
|
||||
# then Nginx will encounter an infinite rewriting loop when it prepends `/index.php`
|
||||
# to the URI, resulting in a HTTP 500 error response.
|
||||
location ~ \.php(?:$|/) {
|
||||
# Required for legacy support
|
||||
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
|
||||
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
set $path_info $fastcgi_path_info;
|
||||
|
||||
try_files $fastcgi_script_name =404;
|
||||
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $path_info;
|
||||
#fastcgi_param HTTPS on;
|
||||
|
||||
fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice
|
||||
fastcgi_param front_controller_active true; # Enable pretty urls
|
||||
fastcgi_pass php-handler;
|
||||
|
||||
fastcgi_intercept_errors on;
|
||||
fastcgi_request_buffering off;
|
||||
}
|
||||
|
||||
location ~ \.(?:css|js|svg|gif)$ {
|
||||
try_files $uri /index.php$request_uri;
|
||||
expires 6M; # Cache-Control policy borrowed from `.htaccess`
|
||||
access_log off; # Optional: Don't log access to assets
|
||||
}
|
||||
|
||||
location ~ \.woff2?$ {
|
||||
try_files $uri /index.php$request_uri;
|
||||
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
||||
access_log off; # Optional: Don't log access to assets
|
||||
}
|
||||
|
||||
# Rule borrowed from `.htaccess`
|
||||
location /remote {
|
||||
return 301 /remote.php$request_uri;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php$request_uri;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
services:
|
||||
ntfy:
|
||||
image: binwiederhier/ntfy:v2.23
|
||||
container_name: ntfy
|
||||
command:
|
||||
- serve
|
||||
volumes:
|
||||
- /appli/data/ntfy/data:/var/cache/ntfy
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- NTFY_BASE_URL=https://${URL}
|
||||
- NTFY_CACHE_FILE=/var/cache/ntfy/cache.db
|
||||
- NTFY_AUTH_FILE=/var/cache/ntfy/auth.db
|
||||
- NTFY_ATTACHMENT_CACHE_DIR=/var/cache/ntfy/attachments
|
||||
- NTFY_AUTH_DEFAULT_ACCESS=deny-all
|
||||
- NTFY_BEHIND_PROXY=true
|
||||
- NTFY_ENABLE_LOGIN=true
|
||||
user: 1000:1000
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.ntfy.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.ntfy.entrypoints=https
|
||||
- traefik.http.routers.ntfy.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.ntfy.loadbalancer.server.port=80
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -q --tries=1 http://ntfy:80/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"]
|
||||
interval: 60s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,62 +0,0 @@
|
||||
services:
|
||||
phpipam-web:
|
||||
image: phpipam/phpipam-www:latest
|
||||
container_name: phpipam_web
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- IPAM_DATABASE_HOST=phpipam-mariadb
|
||||
- IPAM_DATABASE_PASS=${IPAM_DATABASE_PASS}
|
||||
- IPAM_DATABASE_WEBHOST=%
|
||||
- IPAM_TRUST_X_FORWARDED=true
|
||||
volumes:
|
||||
- /appli/data/phpipam/logo:/phpipam/css/images/logo
|
||||
- /appli/data/phpipam/ca:/usr/local/share/ca-certificates:ro
|
||||
depends_on:
|
||||
- phpipam-mariadb
|
||||
networks:
|
||||
- web
|
||||
- backend
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.phpipam.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.phpipam.entrypoints=https
|
||||
- traefik.http.routers.phpipam.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.phpipam.loadbalancer.server.port=80
|
||||
restart: unless-stopped
|
||||
|
||||
|
||||
phpipam-cron:
|
||||
image: phpipam/phpipam-cron:latest
|
||||
container_name: phpipam_cron
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- IPAM_DATABASE_HOST=phpipam-mariadb
|
||||
- IPAM_DATABASE_PASS=${IPAM_DATABASE_PASS}
|
||||
- SCAN_INTERVAL=1h
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /appli/data/phpipam/ca:/usr/local/share/ca-certificates:ro
|
||||
networks:
|
||||
- lan
|
||||
- backend
|
||||
depends_on:
|
||||
- phpipam-mariadb
|
||||
|
||||
phpipam-mariadb:
|
||||
image: mariadb:latest
|
||||
container_name: phpipam_db
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||
volumes:
|
||||
- /appli/data/phpipam/db:/var/lib/mysql
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
backend:
|
||||
lan:
|
||||
external: true
|
||||
web:
|
||||
external: true
|
||||
@@ -1,20 +0,0 @@
|
||||
services:
|
||||
portainer:
|
||||
image: portainer/portainer-ce:2.40.0-alpine
|
||||
container_name: portainer
|
||||
volumes:
|
||||
- /appli/data/portainer/data:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.portainer.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.portainer.entrypoints=https
|
||||
- traefik.http.routers.portainer.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.portainer.loadbalancer.server.port=9000
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,131 +0,0 @@
|
||||
services:
|
||||
|
||||
sonarr:
|
||||
image: linuxserver/sonarr
|
||||
container_name: sonarr
|
||||
environment:
|
||||
- PUID=3120
|
||||
- PGID=3120
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
- /appli/data/seedbox/sonarr:/config
|
||||
- /data/videos/Series:/tv
|
||||
- /data/downloads:/downloads
|
||||
networks:
|
||||
- web
|
||||
- backend
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.sonarr.rule=Host(`${URL_SONARR}`)
|
||||
- traefik.http.routers.sonarr.entrypoints=https
|
||||
- traefik.http.routers.sonarr.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.sonarr.loadbalancer.server.port=8989
|
||||
restart: unless-stopped
|
||||
|
||||
radarr:
|
||||
image: linuxserver/radarr
|
||||
container_name: radarr
|
||||
environment:
|
||||
- PUID=3120
|
||||
- PGID=3120
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
- /appli/data/seedbox/radarr:/config
|
||||
- /data/videos/Films:/movies
|
||||
- /data/downloads:/downloads
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.radarr.rule=Host(`${URL_RADARR}`)
|
||||
- traefik.http.routers.radarr.entrypoints=https
|
||||
- traefik.http.routers.radarr.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.radarr.loadbalancer.server.port=7878
|
||||
restart: always
|
||||
|
||||
prowlarr:
|
||||
image: lscr.io/linuxserver/prowlarr:latest
|
||||
container_name: prowlarr
|
||||
environment:
|
||||
- PUID=3120
|
||||
- PGID=3120
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
- /appli/data/seedbox/prowlarr:/config
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.prowlarr.rule=Host(`${URL_PROWLARR}`)
|
||||
- traefik.http.routers.prowlarr.entrypoints=https
|
||||
- traefik.http.routers.prowlarr.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.prowlarr.loadbalancer.server.port=9696
|
||||
restart: unless-stopped
|
||||
|
||||
transmission:
|
||||
image: linuxserver/transmission
|
||||
container_name: transmission
|
||||
environment:
|
||||
- PUID=3120
|
||||
- PGID=3120
|
||||
- TZ=Europe/Paris
|
||||
#- TRANSMISSION_WEB_HOME=/combustion-release/ #optional
|
||||
- USER=${USER_TRANSMISSION} #optional
|
||||
- PASS=${PASS_TRANSMISSION} #optional
|
||||
volumes:
|
||||
- /appli/data/seedbox/transmission:/config
|
||||
- /data/downloads:/downloads
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
ports:
|
||||
- 51413:51413
|
||||
- 51413:51413/udp
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.transmission.rule=Host(`${URL_TRANSMISSION}`)
|
||||
- traefik.http.routers.transmission.entrypoints=https
|
||||
- traefik.http.routers.transmission.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.transmission.loadbalancer.server.port=9091
|
||||
restart: always
|
||||
|
||||
flaresolverr:
|
||||
#image: ghcr.io/flaresolverr/flaresolverr:pr-1282
|
||||
image: flaresolverr/flaresolverr
|
||||
container_name: flaresolverr
|
||||
environment:
|
||||
- LOG_LEVEL=${LOG_LEVEL:-debug}
|
||||
- LOG_HTML=${LOG_HTML:-false}
|
||||
- CAPTCHA_SOLVER=${CAPTCHA_SOLVER:-none}
|
||||
- TZ=Europe/Paris
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- backend
|
||||
|
||||
bazarr:
|
||||
image: linuxserver/bazarr
|
||||
container_name: bazarr
|
||||
environment:
|
||||
- PUID=3120
|
||||
- PGID=3120
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
- /appli/data/seedbox/bazarr:/config
|
||||
- /data/videos/Series:/tv
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.bazarr.rule=Host(`${URL_BAZARR}`)
|
||||
- traefik.http.routers.bazarr.entrypoints=https
|
||||
- traefik.http.routers.bazarr.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.bazarr.loadbalancer.server.port=6767
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
backend:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,52 +0,0 @@
|
||||
services:
|
||||
semaphore:
|
||||
image: semaphoreui/semaphore:v2.18.8
|
||||
container_name: semaphore_ui
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- SEMAPHORE_DB_USER=${POSTGRES_USER}
|
||||
- SEMAPHORE_DB_PASS=${POSTGRES_PASSWORD}
|
||||
- SEMAPHORE_DB_HOST=postgres
|
||||
- SEMAPHORE_DB_PORT=5432
|
||||
- SEMAPHORE_DB_DIALECT=postgres
|
||||
- SEMAPHORE_DB=${POSTGRES_DB}
|
||||
- SEMAPHORE_PLAYBOOK_PATH=/tmp/semaphore/
|
||||
- SEMAPHORE_ADMIN_PASSWORD=${SEMAPHORE_ADMIN_PASSWORD}
|
||||
- SEMAPHORE_ADMIN_NAME=${SEMAPHORE_ADMIN_NAME}
|
||||
- SEMAPHORE_ADMIN_EMAIL=${SEMAPHORE_ADMIN_EMAIL}
|
||||
- SEMAPHORE_ADMIN=${SEMAPHORE_ADMIN}
|
||||
- SEMAPHORE_ACCESS_KEY_ENCRYPTION=${SEMAPHORE_ACCESS_KEY_ENCRYPTION}
|
||||
- SEMAPHORE_LDAP_ACTIVATED='no'
|
||||
volumes:
|
||||
- /appli/docker/semaphore/requirements.txt:/etc/semaphore/requirements.txt
|
||||
depends_on:
|
||||
- postgres
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.semaphore.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.semaphore.entrypoints=https
|
||||
- traefik.http.routers.semaphore.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.semaphore.loadbalancer.server.port=3000
|
||||
restart: unless-stopped
|
||||
|
||||
postgres:
|
||||
image: postgres:14
|
||||
hostname: postgres
|
||||
container_name: semaphore_postgres
|
||||
volumes:
|
||||
- /appli/data/semaphore/db:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
backend:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,2 +0,0 @@
|
||||
proxmoxer>=2.3,<3
|
||||
requests>=2.31,<3
|
||||
@@ -1,22 +0,0 @@
|
||||
services:
|
||||
stirling-pdf:
|
||||
image: stirlingtools/stirling-pdf:latest
|
||||
container_name: stirling-pdf
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /appli/data/stirling-pdf:/configs
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.stirling.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.stirling.entrypoints=https
|
||||
- traefik.http.routers.stirling.tls=true
|
||||
- traefik.http.routers.stirling.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.stirling.loadbalancer.server.port=8080
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,40 +0,0 @@
|
||||
services:
|
||||
app:
|
||||
image: traefik:3
|
||||
container_name: traefik
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- /appli/data/traefik/files:/files
|
||||
- /appli/data/traefik/certs/ca:/ca
|
||||
- /appli/data/traefik/config/traefik.yml:/etc/traefik/traefik.yml
|
||||
- /appli/data/traefik/config/users:/users
|
||||
- /appli/data/traefik/acme.json:/acme.json
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
# Dashboard
|
||||
- traefik.http.routers.dashboard.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.dashboard.service=api@internal
|
||||
- traefik.http.routers.dashboard.entrypoints=https
|
||||
- traefik.http.routers.dashboard.tls=true
|
||||
- traefik.http.routers.dashboard.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.dashboard.middlewares=local-only@file
|
||||
# Redirect HTTP to HTTPS
|
||||
- traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)
|
||||
- traefik.http.routers.http-catchall.entrypoints=http
|
||||
- traefik.http.routers.http-catchall.middlewares=redirect-to-https
|
||||
- traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
|
||||
# Dummy
|
||||
- traefik.http.services.dummy-svc.loadbalancer.server.port=9999
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
services:
|
||||
umami:
|
||||
image: ghcr.io/umami-software/umami:3
|
||||
container_name: umami_server
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@umami_db:5432/${POSTGRES_DB}
|
||||
- DATABASE_TYPE=postgresql
|
||||
- APP_SECRET=${APP_SECRET}
|
||||
- IGNORE_IP=${IGNORE_IP}
|
||||
networks:
|
||||
- backend
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.umami.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.umami.entrypoints=https
|
||||
- traefik.http.routers.umami.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.umami.loadbalancer.server.port=3000
|
||||
restart: on-failure
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
init: true
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
container_name: umami_db
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
volumes:
|
||||
- /appli/data/umami/:/var/lib/postgresql/data
|
||||
networks:
|
||||
- backend
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
backend:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,68 +0,0 @@
|
||||
services:
|
||||
network_application:
|
||||
image: lscr.io/linuxserver/unifi-network-application:10.6.109-ls152
|
||||
container_name: unifi_network_application
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Paris
|
||||
- MONGO_USER=${MONGO_USER}
|
||||
- MONGO_PASS=${MONGO_PASS}
|
||||
- MONGO_HOST=unifi_db
|
||||
- MONGO_PORT=27017
|
||||
- MONGO_DBNAME=${MONGO_DBNAME}
|
||||
- MONGO_AUTHSOURCE=${MONGO_AUTHSOURCE}
|
||||
#- MEM_LIMIT=1024 #optional
|
||||
#- MEM_STARTUP=1024 #optional
|
||||
#- MONGO_TLS= #optional
|
||||
volumes:
|
||||
- /appli/data/unifi/config:/config
|
||||
ports:
|
||||
#- 443:443
|
||||
- 3478:3478/udp
|
||||
- 10001:10001/udp
|
||||
- 8080:8080
|
||||
- 1900:1900/udp #optional
|
||||
- 8843:8843 #optional
|
||||
- 8880:8880 #optional
|
||||
- 6789:6789 #optional
|
||||
- 5514:5514/udp #optional
|
||||
networks:
|
||||
- unifi
|
||||
- web
|
||||
- backend
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.unifi.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.unifi.entrypoints=https
|
||||
- traefik.http.routers.unifi.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.unifi.loadbalancer.server.port=8443
|
||||
- traefik.http.services.unifi.loadbalancer.server.scheme=https
|
||||
- traefik.http.services.unifi.loadbalancer.serversTransport=insecure@file
|
||||
restart: unless-stopped
|
||||
|
||||
db:
|
||||
image: docker.io/mongo:8.0
|
||||
container_name: unifi_db
|
||||
environment:
|
||||
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
|
||||
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
|
||||
- MONGO_USER=${MONGO_USER}
|
||||
- MONGO_PASS=${MONGO_PASS}
|
||||
- MONGO_DBNAME=${MONGO_DBNAME}
|
||||
- MONGO_AUTHSOURCE=${MONGO_AUTHSOURCE}
|
||||
volumes:
|
||||
- /appli/data/unifi/data:/data/db
|
||||
- /appli/docker/unifi/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro
|
||||
networks:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
backend:
|
||||
unifi:
|
||||
external: true
|
||||
web:
|
||||
external: true
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if which mongosh > /dev/null 2>&1; then
|
||||
mongo_init_bin='mongosh'
|
||||
else
|
||||
mongo_init_bin='mongo'
|
||||
fi
|
||||
"${mongo_init_bin}" <<EOF
|
||||
use ${MONGO_AUTHSOURCE}
|
||||
db.auth("${MONGO_INITDB_ROOT_USERNAME}", "${MONGO_INITDB_ROOT_PASSWORD}")
|
||||
db.createUser({
|
||||
user: "${MONGO_USER}",
|
||||
pwd: "${MONGO_PASS}",
|
||||
roles: [
|
||||
{ db: "${MONGO_DBNAME}", role: "dbOwner" },
|
||||
{ db: "${MONGO_DBNAME}_stat", role: "dbOwner" },
|
||||
{ db: "${MONGO_DBNAME}_audit", role: "dbOwner" }
|
||||
]
|
||||
})
|
||||
EOF
|
||||
@@ -1,28 +0,0 @@
|
||||
services:
|
||||
vaultwarden:
|
||||
image: vaultwarden/server:1.37.1-alpine
|
||||
container_name: vaultwarden
|
||||
volumes:
|
||||
- /appli/data/vaultwarden/data/:/data
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- DOMAIN=https://${URL}
|
||||
- SMTP_HOST=smtp.gmail.com
|
||||
- SMTP_PORT=465
|
||||
- SMTP_SECURITY=force_tls
|
||||
- SMTP_FROM=${SMTP_USERNAME}
|
||||
- SMTP_USERNAME=${SMTP_USERNAME}
|
||||
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.vaultwarden.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.vaultwarden.entrypoints=https
|
||||
- traefik.http.routers.vaultwarden.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.vaultwarden.loadbalancer.server.port=80
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,23 +0,0 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
vscode:
|
||||
image: codercom/code-server
|
||||
container_name: vscode
|
||||
volumes:
|
||||
- /appli/data/vscode/project:/home/coder/project
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.vscode.rule=Host(`${URL}`)
|
||||
- traefik.http.routers.vscode.entrypoints=https
|
||||
- traefik.http.routers.vscode.tls.certresolver=letsencrypt
|
||||
- traefik.http.services.vscode.loadbalancer.server.port=8080
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -1,57 +0,0 @@
|
||||
# Kubernetes
|
||||
|
||||
## Overview
|
||||
|
||||
The lab inventory records six Kubernetes VMs on Proxmox: three control-plane nodes with stacked etcd and three workers. Kubernetes and Cilium are deployed, with worker BGP sessions to OPNsense recorded as established. No application workloads are deployed. This describes the documented state, not a live verification.
|
||||
|
||||
Terraform provisions the VMs, Ansible prepares the nodes, and bootstrap and initial component installation are manual. Background: [migration roadmap](https://blog.vezpi.com/en/post/roadmap-migrate-docker-applications-kubernetes/).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Provision the VMs with the [Terraform Kubernetes VMs documentation](../terraform/projects/kubernetes_vms/README.md).
|
||||
2. Prepare all nodes with the [Ansible Kubernetes nodes documentation](../ansible/kubernetes/README.md). It configures swap, kernel settings, containerd, Kubernetes packages and the host firewall, but does not run `kubeadm init` or `kubeadm join`. Review the [Ansible defaults](../ansible/kubernetes/roles/k8s_node/defaults/main.yml) and adapt inventory paths and firewall ranges, including Cilium and BGP traffic.
|
||||
3. Provide working node DNS and a stable API DNS endpoint on TCP port `6443`; the lab uses HAProxy on OPNsense across the control-plane nodes.
|
||||
4. Install `kubectl` and the Cilium CLI on the administration machine, and check the intended cluster context. Keep credentials, kubeconfigs, join tokens and Terraform state out of Git.
|
||||
|
||||
Walkthrough: [Automating Kubernetes VM Deployment with Terraform and Ansible](https://blog.vezpi.com/en/post/automate-kubernetes-vms-terraform-ansible/).
|
||||
|
||||
## Cluster bootstrap: kubeadm
|
||||
|
||||
For a **new, prepared cluster**, initialize the first control-plane node with the target API DNS name and a non-overlapping pod CIDR:
|
||||
|
||||
```text
|
||||
sudo kubeadm init \
|
||||
--control-plane-endpoint "<API_DNS>:6443" \
|
||||
--upload-certs \
|
||||
--pod-network-cidr=<POD_CIDR>
|
||||
```
|
||||
|
||||
Configure `kubectl` using the generated admin kubeconfig. Join the remaining nodes with freshly generated commands: include `--control-plane` and `--certificate-key` for additional control planes, but not workers. Install Cilium below; nodes can remain `NotReady` until the CNI works.
|
||||
|
||||
Walkthrough: [Create a Highly Available Kubernetes Cluster with kubeadm on VMs](https://blog.vezpi.com/en/post/create-manual-kubernetes-cluster-kubeadm/). Its names, versions and firewall shortcuts are historical; use the Ansible preparation above rather than disabling the firewall.
|
||||
|
||||
**Installation caveat:** these historical commands are not a tested, reproducible rebuild procedure or instructions to reinstall the existing cluster. Exact Kubernetes package builds are unpinned; the historical CLI installer uses a moving `stable.txt`, and `cilium install` omits `--version`.
|
||||
|
||||
## Networking: Cilium
|
||||
|
||||
### CNI and pod connectivity
|
||||
|
||||
Cilium provides pod networking. The [bootstrap walkthrough](https://blog.vezpi.com/en/post/create-manual-kubernetes-cluster-kubeadm/) covers its checksum-verified, architecture-specific CLI download and connectivity testing; it predates this cluster's BGP setup.
|
||||
|
||||
The recorded fresh-cluster installation enables the BGP control plane:
|
||||
|
||||
```bash
|
||||
cilium install --set bgpControlPlane.enabled=true
|
||||
cilium status --wait
|
||||
kubectl get nodes
|
||||
```
|
||||
|
||||
Check for healthy Cilium components and all six nodes `Ready`. The optional `cilium connectivity test` exercises pod networking and DNS but creates temporary workloads; run only with approval and account for cleanup.
|
||||
|
||||
### BGP
|
||||
|
||||
Cilium peers with OPNsense FRR to advertise service `LoadBalancerIP` addresses. The recorded configuration uses `CiliumBGPPeerConfig` for peer settings and advertisement selection, `CiliumBGPClusterConfig` for worker selection and peering, and `CiliumBGPAdvertisement` for service advertisements.
|
||||
|
||||
The setup pairs FRR/BGP and firewall access on OPNsense with worker labels and matching peer settings and advertisement labels. Check sessions with `cilium bgp peers`; worker sessions are recorded as established, but that alone does not prove LoadBalancer address allocation, advertisement or reachability.
|
||||
|
||||
**BGP service exposure: ongoing.**
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
apiVersion: cilium.io/v2
|
||||
kind: CiliumBGPPeerConfig
|
||||
metadata:
|
||||
name: bgp-cilium-peers
|
||||
spec:
|
||||
timers:
|
||||
holdTimeSeconds: 9
|
||||
keepAliveTimeSeconds: 3
|
||||
gracefulRestart:
|
||||
enabled: true
|
||||
restartTimeSeconds: 15
|
||||
families:
|
||||
- afi: ipv4
|
||||
safi: unicast
|
||||
advertisements:
|
||||
matchLabels:
|
||||
advertise: "bgp"
|
||||
---
|
||||
apiVersion: cilium.io/v2
|
||||
kind: CiliumBGPClusterConfig
|
||||
metadata:
|
||||
name: bgp-opnsense
|
||||
spec:
|
||||
nodeSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/role: "worker"
|
||||
bgpInstances:
|
||||
- name: "bgp-cilium-cluster"
|
||||
localASN: 64513 # Cilium ASN
|
||||
peers:
|
||||
- name: "opnsense"
|
||||
peerASN: 64512 # OPNsense ASN
|
||||
peerAddress: 192.168.66.1 # OPNsense IP on the Lab network
|
||||
peerConfigRef:
|
||||
name: "bgp-cilium-peers"
|
||||
---
|
||||
apiVersion: cilium.io/v2
|
||||
kind: CiliumBGPAdvertisement
|
||||
metadata:
|
||||
name: bgp-advertisement
|
||||
labels:
|
||||
advertise: bgp
|
||||
spec:
|
||||
advertisements:
|
||||
- advertisementType: "Service"
|
||||
service:
|
||||
addresses:
|
||||
- LoadBalancerIP
|
||||
@@ -31,8 +31,7 @@ variable "vm_user_sshkeys" {
|
||||
type = list(string)
|
||||
default = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID62LmYRu1rDUha3timAIcA39LtcIOny1iAgFLnxoBxm vez@bastion",
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHovfHKpqTvwj5zrcSuSZALa8iiH6qBvE5dyJCz9eQ2k vez@surface",
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG9bx04oxnZTmMm/7U9lUlhZM64xIMUSx48JiwxUH86x semaphore"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHovfHKpqTvwj5zrcSuSZALa8iiH6qBvE5dyJCz9eQ2k vez@surface"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user