137 lines
2.6 KiB
Markdown
137 lines
2.6 KiB
Markdown
# Immich Ansible
|
|
|
|
Playbook Ansible pour installer Immich auto-hébergé avec Docker Compose, PostgreSQL, Redis/Valkey, machine-learning et Nginx/Certbot.
|
|
|
|
Il reprend le modèle du projet Forgejo fourni :
|
|
|
|
- même host Ansible ;
|
|
- installation Docker Compose v2 ;
|
|
- reverse proxy Nginx + certificat Let's Encrypt ;
|
|
- port Docker hôte non standard ;
|
|
- données applicatives persistantes bind-mountées sur le partage NFS.
|
|
|
|
## Structure
|
|
|
|
```text
|
|
immich-ansible/
|
|
├── ansible.cfg
|
|
├── inventory.ini
|
|
├── playbook.yml
|
|
├── group_vars/
|
|
│ └── immich.yml
|
|
├── templates/
|
|
│ ├── .env.j2
|
|
│ └── docker-compose.yml.j2
|
|
└── roles/
|
|
└── nginx/
|
|
```
|
|
|
|
## Configuration appliquée
|
|
|
|
```yaml
|
|
immich_domain: "immich.esfs.fr"
|
|
immich_dir: "/opt/immich"
|
|
nfs_mount_point: "/mnt/nfs-share"
|
|
immich_library_path: "/mnt/nfs-share/applications/immich/library"
|
|
immich_postgres_data_path: "/opt/immich/postgres"
|
|
immich_host_http_port: "32283"
|
|
immich_container_http_port: "2283"
|
|
```
|
|
|
|
Nginx proxy vers :
|
|
|
|
```text
|
|
http://127.0.0.1:32283
|
|
```
|
|
|
|
L'accès final sera :
|
|
|
|
```text
|
|
https://immich.esfs.fr
|
|
```
|
|
|
|
## Point important sur NFS
|
|
|
|
La bibliothèque Immich est sur NFS :
|
|
|
|
```text
|
|
/mnt/nfs-share/applications/immich/library
|
|
```
|
|
|
|
PostgreSQL est volontairement local :
|
|
|
|
```text
|
|
/opt/immich/postgres
|
|
```
|
|
|
|
C'est fait ainsi parce que le fichier `example.env` officiel Immich précise que les partages réseau ne sont pas supportés pour `DB_DATA_LOCATION`. C'est aussi cohérent avec le projet Forgejo fourni, où les données Forgejo sont sur NFS mais PostgreSQL reste local.
|
|
|
|
## Lancement
|
|
|
|
Depuis le dossier du projet :
|
|
|
|
```bash
|
|
ansible-playbook playbook.yml
|
|
```
|
|
|
|
Ou explicitement :
|
|
|
|
```bash
|
|
ansible-playbook -i inventory.ini playbook.yml
|
|
```
|
|
|
|
## Après installation
|
|
|
|
Ouvre :
|
|
|
|
```text
|
|
https://immich.esfs.fr
|
|
```
|
|
|
|
Puis crée le premier compte administrateur via l'assistant Immich.
|
|
|
|
## Variables utiles
|
|
|
|
Dans `group_vars/immich.yml` :
|
|
|
|
```yaml
|
|
immich_db_password: "Yb8qD7vRc4Nz29AhKp6Lx5Tf"
|
|
immich_version: "v2"
|
|
immich_host_http_port: "32283"
|
|
immich_nginx_client_max_body_size: "10G"
|
|
```
|
|
|
|
Le mot de passe PostgreSQL est volontairement alphanumérique uniquement.
|
|
|
|
## Mise à jour Immich
|
|
|
|
Sur le serveur :
|
|
|
|
```bash
|
|
cd /opt/immich
|
|
docker compose pull
|
|
docker compose up -d
|
|
```
|
|
|
|
Ou relancer le playbook Ansible.
|
|
|
|
## Sauvegarde
|
|
|
|
À sauvegarder régulièrement :
|
|
|
|
```text
|
|
/mnt/nfs-share/applications/immich/library
|
|
/opt/immich/postgres
|
|
/opt/immich/docker-compose.yml
|
|
/opt/immich/.env
|
|
```
|
|
|
|
Pour une sauvegarde froide :
|
|
|
|
```bash
|
|
cd /opt/immich
|
|
docker compose down
|
|
# sauvegarde
|
|
docker compose up -d
|
|
```
|
|
|