Initialise repository structure and placeholder files. Generic functionality works i guess, need to come up with a better solution for compose templates
This commit is contained in:
commit
53695f4fff
411 files changed
+7817
No files matched your search
@@ -0,0 +1,6 @@
|
||||
# immich
|
||||
|
||||
Deploys Immich with server, machine learning, Redis, and PostgreSQL services.
|
||||
|
||||
Tags: `immich`, `config`, `compose`, `firewall`.
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
immich_dir: /srv/docker/immich
|
||||
immich_server_image: ghcr.io/immich-app/immich-server:release
|
||||
immich_ml_image: ghcr.io/immich-app/immich-machine-learning:release
|
||||
immich_postgres_image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0
|
||||
immich_redis_image: docker.io/library/redis:7-alpine
|
||||
immich_http_port: 2283
|
||||
immich_domain: immich.example.invalid
|
||||
immich_routing_mode: "{{ nbops_service_routing_mode }}"
|
||||
immich_traefik_network: "{{ nbops_proxy_network }}"
|
||||
immich_traefik_entrypoint: "{{ nbops_traefik_entrypoint }}"
|
||||
immich_traefik_tls: "{{ nbops_traefik_tls }}"
|
||||
immich_upload_location: /srv/media/immich
|
||||
immich_database_password: "{{ vault_immich_database_password | default('CHANGE_ME_IN_VAULT') }}"
|
||||
immich_env:
|
||||
DB_HOSTNAME: database
|
||||
DB_USERNAME: postgres
|
||||
DB_DATABASE_NAME: immich
|
||||
DB_PASSWORD: "{{ immich_database_password }}"
|
||||
REDIS_HOSTNAME: redis
|
||||
UPLOAD_LOCATION: "{{ immich_upload_location }}"
|
||||
immich_tcp_ports:
|
||||
- "{{ immich_http_port }}"
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: restart immich
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ immich_dir }}"
|
||||
state: restarted
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
- name: Create Immich directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
loop:
|
||||
- "{{ immich_dir }}"
|
||||
- "{{ immich_upload_location }}"
|
||||
tags: [immich]
|
||||
|
||||
- name: Render Immich environment
|
||||
ansible.builtin.template:
|
||||
src: env.j2
|
||||
dest: "{{ immich_dir }}/.env"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0600"
|
||||
no_log: true
|
||||
tags: [immich, config]
|
||||
|
||||
- name: Ensure Immich proxy network exists
|
||||
community.docker.docker_network:
|
||||
name: "{{ immich_traefik_network }}"
|
||||
state: present
|
||||
when: immich_routing_mode == "traefik"
|
||||
tags: [immich, docker]
|
||||
|
||||
- name: Render Immich Compose file
|
||||
ansible.builtin.template:
|
||||
src: compose.yaml.j2
|
||||
dest: "{{ immich_dir }}/compose.yaml"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: restart immich
|
||||
tags: [immich, compose]
|
||||
|
||||
- name: Allow Immich ports
|
||||
community.general.ufw:
|
||||
rule: allow
|
||||
port: "{{ item }}"
|
||||
proto: tcp
|
||||
loop: "{{ immich_tcp_ports }}"
|
||||
when: immich_routing_mode == "host"
|
||||
tags: [immich, firewall]
|
||||
|
||||
- name: Start Immich
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ immich_dir }}"
|
||||
state: present
|
||||
tags: [immich, compose]
|
||||
@@ -0,0 +1,48 @@
|
||||
services:
|
||||
immich-server:
|
||||
image: {{ immich_server_image }}
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
{% if immich_routing_mode == "host" %}
|
||||
ports:
|
||||
- "{{ immich_http_port }}:2283"
|
||||
{% endif %}
|
||||
{% if immich_routing_mode == "traefik" %}
|
||||
# internal HTTP service port: 2283; not published on the Docker host
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.immich.rule=Host(`{{ immich_domain }}`)
|
||||
- traefik.http.routers.immich.entrypoints={{ immich_traefik_entrypoint }}
|
||||
- traefik.http.routers.immich.tls={{ immich_traefik_tls | bool | ternary('true', 'false') }}
|
||||
- traefik.http.services.immich.loadbalancer.server.port=2283
|
||||
networks:
|
||||
- default
|
||||
- {{ immich_traefik_network }}
|
||||
{% endif %}
|
||||
volumes:
|
||||
- {{ immich_upload_location }}:/usr/src/app/upload
|
||||
depends_on:
|
||||
- redis
|
||||
- database
|
||||
immich-machine-learning:
|
||||
image: {{ immich_ml_image }}
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./model-cache:/cache
|
||||
redis:
|
||||
image: {{ immich_redis_image }}
|
||||
restart: unless-stopped
|
||||
database:
|
||||
image: {{ immich_postgres_image }}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_USER: ${DB_USERNAME}
|
||||
POSTGRES_DB: ${DB_DATABASE_NAME}
|
||||
volumes:
|
||||
- ./postgres:/var/lib/postgresql/data
|
||||
{% if immich_routing_mode == "traefik" %}
|
||||
networks:
|
||||
{{ immich_traefik_network }}:
|
||||
external: true
|
||||
{% endif %}
|
||||
@@ -0,0 +1,4 @@
|
||||
{% for key, value in immich_env.items() %}
|
||||
{{ key }}={{ value }}
|
||||
{% endfor %}
|
||||
|
||||
Reference in new issue
Block a user