Deploy immich
This commit is contained in:
parent
48b17ebf6b
commit
b45f0ed2ae
5 changed files with 97 additions and 0 deletions
ansible
terraform
|
@ -72,6 +72,7 @@
|
|||
- ntfy
|
||||
- baby_buddy
|
||||
- bsky
|
||||
- immich
|
||||
|
||||
- hosts: ingress
|
||||
roles:
|
||||
|
|
69
ansible/roles/immich/files/docker-compose.yml
Normal file
69
ansible/roles/immich/files/docker-compose.yml
Normal file
|
@ -0,0 +1,69 @@
|
|||
|
||||
|
||||
services:
|
||||
immich-server:
|
||||
container_name: immich_server
|
||||
image: ghcr.io/immich-app/immich-server:release
|
||||
user: "{{ docker_user.id }}"
|
||||
volumes:
|
||||
- /mnt/tank/files/immich:/usr/src/app/upload
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /mnt/tank/files/photos:/mnt/photos:ro
|
||||
depends_on:
|
||||
- redis
|
||||
- database
|
||||
- immich-machine-learning
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:postgres@database/immich
|
||||
- TZ={{ timezone }}
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.immich.rule=Host(`immich.jakehoward.tech`)
|
||||
- traefik.http.routers.immich.middlewares=tailscale-only@file
|
||||
networks:
|
||||
- default
|
||||
- traefik
|
||||
|
||||
immich-machine-learning:
|
||||
container_name: immich_machine_learning
|
||||
image: ghcr.io/immich-app/immich-machine-learning:release
|
||||
user: "{{ docker_user.id }}"
|
||||
volumes:
|
||||
- /mnt/scratch/immich-model-cache:/cache
|
||||
- /mnt/scratch/immich-ml-cache:/.cache
|
||||
- /mnt/scratch/immich-ml-config:/.config
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:postgres@database/immich
|
||||
- MACHINE_LEARNING_WORKER_TIMEOUT=240
|
||||
restart: unless-stopped
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
depends_on:
|
||||
- database
|
||||
- redis
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /mnt/speed/dbs/redis/immich:/data
|
||||
|
||||
database:
|
||||
container_name: immich_postgres
|
||||
image: tensorchord/pgvecto-rs:pg14-v0.2.0
|
||||
environment:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_DB: immich
|
||||
POSTGRES_INITDB_ARGS: '--data-checksums'
|
||||
volumes:
|
||||
- /mnt/speed/dbs/postgres/immich:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
command: ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
|
||||
|
||||
networks:
|
||||
traefik:
|
||||
external: true
|
4
ansible/roles/immich/handlers/main.yml
Normal file
4
ansible/roles/immich/handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: restart immich
|
||||
shell:
|
||||
chdir: /opt/immich
|
||||
cmd: "{{ docker_update_command }}"
|
15
ansible/roles/immich/tasks/main.yml
Normal file
15
ansible/roles/immich/tasks/main.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
- name: Create install directory
|
||||
file:
|
||||
path: /opt/immich
|
||||
state: directory
|
||||
owner: "{{ docker_user.name }}"
|
||||
mode: "{{ docker_compose_directory_mask }}"
|
||||
|
||||
- name: Install compose file
|
||||
template:
|
||||
src: files/docker-compose.yml
|
||||
dest: /opt/immich/docker-compose.yml
|
||||
mode: "{{ docker_compose_file_mask }}"
|
||||
owner: "{{ docker_user.name }}"
|
||||
validate: docker-compose -f %s config
|
||||
notify: restart immich
|
|
@ -277,6 +277,14 @@ resource "cloudflare_record" "jakehowardtech_baby-buddy" {
|
|||
ttl = 1
|
||||
}
|
||||
|
||||
resource "cloudflare_record" "jakehowardtech_immich" {
|
||||
zone_id = cloudflare_zone.jakehowardtech.id
|
||||
name = "immich"
|
||||
value = cloudflare_record.sys_domain_pve_private.hostname
|
||||
type = "CNAME"
|
||||
ttl = 1
|
||||
}
|
||||
|
||||
resource "cloudflare_record" "jakehowardtech_caa" {
|
||||
zone_id = cloudflare_zone.jakehowardtech.id
|
||||
name = "@"
|
||||
|
|
Loading…
Add table
Reference in a new issue