Skip to content

Commit

Permalink
⬆️ Update immich after breakign changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anarion80 committed Nov 21, 2023
1 parent 7d07252 commit 82caf6e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 109 deletions.
14 changes: 3 additions & 11 deletions roles/immich/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ immich_typesense_memory: 1g
immich_server_memory: 1g
immich_microservices_memory: 1g
immich_machinelearning_memory: 1g
immich_web_memory: 1g
immich_proxy_memory: 1g

# docker
immich_postgres_container_name: "immich_postgres"
Expand All @@ -28,25 +26,19 @@ immich_typesense_container_name: "typesense"
immich_server_container_name: "immich_server"
immich_microservices_container_name: "immich_microservices"
immich_machinelearning_container_name: "immich_machine_learning"
immich_web_container_name: "immich_web"
immich_proxy_container_name: "immich_proxy"

immich_postgres_image: "postgres"
immich_postgres_tag: "14"
immich_postgres_tag: "14-alpine"
immich_redis_image: "redis"
immich_redis_tag: "6.2"
immich_redis_tag: "6.2-alpine"
immich_typesense_image: "typesense/typesense"
immich_typesense_tag: "0.24.0"
immich_typesense_tag: "0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd"
immich_server_image: "ghcr.io/immich-app/immich-server"
immich_server_tag: "release"
immich_microservices_image: "ghcr.io/immich-app/immich-server"
immich_microservices_tag: "release"
immich_machinelearning_image: "ghcr.io/immich-app/immich-machine-learning"
immich_machinelearning_tag: "release"
immich_web_image: "ghcr.io/immich-app/immich-web"
immich_web_tag: "release"
immich_proxy_image: "ghcr.io/immich-app/immich-proxy"
immich_proxy_tag: "release"
immich_user_id: "1000"
immich_group_id: "1000"

Expand Down
14 changes: 0 additions & 14 deletions roles/immich/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@
name: "{{ immich_machinelearning_container_name }}"
register: result_machinelearning

- name: Get Immich Web container state
community.docker.docker_container_info:
name: "{{ immich_web_container_name }}"
register: result_web

- name: Get Immich Proxy container state
community.docker.docker_container_info:
name: "{{ immich_proxy_container_name }}"
register: result_proxy

- name: Check if Immich docker containers are running
ansible.builtin.assert:
that:
Expand All @@ -62,7 +52,3 @@
- result_microservices.container['State']['Restarting'] == false
- result_machinelearning.container['State']['Status'] == "running"
- result_machinelearning.container['State']['Restarting'] == false
- result_web.container['State']['Status'] == "running"
- result_web.container['State']['Restarting'] == false
- result_proxy.container['State']['Status'] == "running"
- result_proxy.container['State']['Restarting'] == false
14 changes: 0 additions & 14 deletions roles/immich/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@
state: absent
register: result_machinelearning

- name: Try and stop and remove Immich Web
community.docker.docker_container:
name: "{{ immich_web_container_name }}"
state: absent
register: result_web

- name: Try and stop and remove Immich Proxy
community.docker.docker_container:
name: "{{ immich_proxy_container_name }}"
state: absent
register: result_proxy

- name: Check if immich containers are stopped
ansible.builtin.assert:
that:
Expand All @@ -64,5 +52,3 @@
- not result_server.changed
- not result_microservices.changed
- not result_machinelearning.changed
- not result_web.changed
- not result_proxy.changed
82 changes: 12 additions & 70 deletions roles/immich/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
name: "{{ immich_redis_container_name }}"
image: "{{ immich_redis_image }}:{{ immich_redis_tag }}"
pull: true
command: --save 60 1 --loglevel warning
volumes:
- "{{ immich_data_directory }}/redis:/data:rw"
networks:
Expand Down Expand Up @@ -73,6 +72,8 @@
env:
TYPESENSE_API_KEY: "{{ immich_typesense_api_key }}"
TYPESENSE_DATA_DIR: "/data"
# remove this to get debug messages
GLOG_minloglevel: "1"
labels:
traefik.enable: "false"
restart_policy: always
Expand All @@ -87,8 +88,11 @@
volumes:
- "{{ immich_data_directory }}/data:/data:rw"
- "{{ immich_upload_directory }}:/usr/src/app/upload:rw"
- /etc/localtime:/etc/localtime:ro
networks:
- name: "{{ immich_network_name }}"
exposed:
- "{{ immich_port }}:3001"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ immich_user_id | quote }}"
Expand All @@ -107,7 +111,12 @@
PUBLIC_LOGIN_PAGE_MESSAGE: "{{ immich_public_login_page_message }}"
TYPESENSE_API_KEY: "{{ immich_typesense_api_key }}"
labels:
traefik.enable: "false"
traefik.enable: "{{ immich_available_externally | string }}"
traefik.http.routers.immich.rule: "Host(`{{ immich_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.immich.tls.certresolver: "letsencrypt"
traefik.http.routers.immich.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.immich.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.immich.loadbalancer.server.port: "3001"
command: ["start.sh", "immich"]
restart_policy: unless-stopped
memory: "{{ immich_server_memory }}"
Expand All @@ -121,6 +130,7 @@
volumes:
- "{{ immich_data_directory }}/data:/data:rw"
- "{{ immich_upload_directory }}:/usr/src/app/upload:rw"
- /etc/localtime:/etc/localtime:ro
networks:
- name: "{{ immich_network_name }}"
env:
Expand Down Expand Up @@ -177,64 +187,6 @@
traefik.enable: "false"
restart_policy: unless-stopped
memory: "{{ immich_machinelearning_memory }}"

- name: Immich Web Docker Container
community.docker.docker_container:
name: "{{ immich_web_container_name }}"
image: "{{ immich_web_image }}:{{ immich_web_tag }}"
pull: true
networks:
- name: "{{ immich_network_name }}"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ immich_user_id | quote }}"
PGID: "{{ immich_group_id | quote }}"
NODE_ENV: "production"
REDIS_HOSTNAME: "{{ immich_redis_container_name }}"
DB_HOSTNAME: "{{ immich_postgres_container_name }}"
DB_USERNAME: "{{ immich_db_username }}"
DB_PASSWORD: "{{ immich_db_password }}"
DB_DATABASE_NAME: "{{ immich_db_name }}"
DB_PORT: "{{ immich_db_port }}"
JWT_SECRET: "{{ immich_jwt_secret }}"
ENABLE_MAPBOX: "{{ immich_enable_mapbox }}"
MAPBOX_KEY: "{{ immich_mapbox_key }}"
UPLOAD_LOCATION: "./upload"
PUBLIC_LOGIN_PAGE_MESSAGE: "{{ immich_public_login_page_message }}"
PUBLIC_IMMICH_SERVER_URL: "http://{{ immich_server_container_name }}:3001"
IMMICH_SERVER_URL: "http://{{ immich_server_container_name }}:3001"
TYPESENSE_API_KEY: "{{ immich_typesense_api_key }}"
labels:
traefik.enable: "false"
restart_policy: unless-stopped
memory: "{{ immich_web_memory }}"

- name: Immich Proxy Docker Container
community.docker.docker_container:
name: "{{ immich_proxy_container_name }}"
image: "{{ immich_proxy_image }}:{{ immich_proxy_tag }}"
pull: true
log_driver: "none"
networks:
- name: "{{ immich_network_name }}"
ports:
- "{{ immich_port }}:8080"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ immich_user_id | quote }}"
PGID: "{{ immich_group_id | quote }}"
NODE_ENV: "production"
IMMICH_SERVER_URL: "http://{{ immich_server_container_name }}:3001"
IMMICH_WEB_URL: "http://{{ immich_web_container_name }}:3000"
labels:
traefik.enable: "{{ immich_available_externally | string }}"
traefik.http.routers.immich.rule: "Host(`{{ immich_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.immich.tls.certresolver: "letsencrypt"
traefik.http.routers.immich.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.immich.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.immich.loadbalancer.server.port: "8080"
restart_policy: unless-stopped
memory: "{{ immich_proxy_memory }}"
when: immich_enabled is true

- name: Stop Immich
Expand Down Expand Up @@ -269,16 +221,6 @@
name: "{{ immich_machinelearning_container_name }}"
state: absent

- name: Stop Immich Web
community.docker.docker_container:
name: "{{ immich_web_container_name }}"
state: absent

- name: Stop Immich Proxy
community.docker.docker_container:
name: "{{ immich_proxy_container_name }}"
state: absent

- name: Delete Immich Network
community.docker.docker_network:
name: "{{ immich_network_name }}"
Expand Down

0 comments on commit 82caf6e

Please sign in to comment.