From 4e7c4bef86d614c2853c48a918886fde05e3f60f Mon Sep 17 00:00:00 2001 From: Lorenzo Carbonell Date: Fri, 14 Oct 2022 07:15:30 +0200 Subject: [PATCH] immich --- immich/README.md | 29 +++++++++ immich/docker-compose.caddy.yml | 13 ++++ immich/docker-compose.traefik.yml | 21 +++++++ immich/docker-compose.yml | 101 ++++++++++++++++++++++++++++++ immich/sample.env | 68 ++++++++++++++++++++ 5 files changed, 232 insertions(+) create mode 100644 immich/README.md create mode 100644 immich/docker-compose.caddy.yml create mode 100644 immich/docker-compose.traefik.yml create mode 100644 immich/docker-compose.yml create mode 100644 immich/sample.env diff --git a/immich/README.md b/immich/README.md new file mode 100644 index 0000000..cd79209 --- /dev/null +++ b/immich/README.md @@ -0,0 +1,29 @@ +# Installation + +``` +git clone https://github.com/atareao/self-hosted.git +cd self-hosted/immich +mv sample.env .env +sed -i "s/immich.tuservidor.es/el_fqdn_que_quieras/g" .env +``` + +Crea un valor para `JWT_SECRET`, para ello, tienes que utilizar el siguiente comando, + +``` +openssl rand -base64 128 +``` + +A la hora de levantar el servicio dependerá del proxy inverso que hayas seleccionado. Si has elegido Caddy, simplemente, + +``` +docker-compose -f docker-compose.yml -f docker-compose.caddy.yml up -d +docker-compose logs -f +``` + +Mientras que si has elegido Traefik, + +``` +docker-compose -f docker-compose.yml -f docker-compose.traefik.yml up -d +docker-compose logs -f +``` + diff --git a/immich/docker-compose.caddy.yml b/immich/docker-compose.caddy.yml new file mode 100644 index 0000000..e89bcbd --- /dev/null +++ b/immich/docker-compose.caddy.yml @@ -0,0 +1,13 @@ +version: "3" + +services: + immich-proxy: + networks: + - proxy + labels: + - caddy="${FQDN}" + - caddy.reverse_proxy="{{upstreams 8080}}" + +networks: + proxy: + external: true diff --git a/immich/docker-compose.traefik.yml b/immich/docker-compose.traefik.yml new file mode 100644 index 0000000..8ce2bd2 --- /dev/null +++ b/immich/docker-compose.traefik.yml @@ -0,0 +1,21 @@ +version: "3" + +services: + immich-proxy: + networks: + - proxy + labels: + - traefik.enable=true + - traefik.http.services.immich.loadbalancer.server.port=8080 + - traefik.http.routers.immich.entrypoints=web + - traefik.http.routers.immich.rule=Host(`${FQDN}`) + - traefik.http.middlewares.immich-https-redirect.redirectscheme.scheme=websecure + - traefik.http.routers.immich.middlewares=immich-https-redirect + - traefik.http.routers.immich-secure.entrypoints=websecure + - traefik.http.routers.immich-secure.rule=Host(`${FQDN}`) + - traefik.http.routers.immich-secure.tls=true + - traefik.http.routers.immich-secure.tls.certresolver=letsencrypt + +networks: + proxy: + external: true diff --git a/immich/docker-compose.yml b/immich/docker-compose.yml new file mode 100644 index 0000000..937f157 --- /dev/null +++ b/immich/docker-compose.yml @@ -0,0 +1,101 @@ +version: "3.8" + +services: + immich-server: + image: altran1502/immich-server:release + entrypoint: ["/bin/sh", "./start-server.sh"] + volumes: + - ./upload:/usr/src/app/upload + env_file: + - .env + environment: + - NODE_ENV=production + depends_on: + - redis + - database + restart: always + networks: + - internal + + immich-microservices: + image: altran1502/immich-server:release + entrypoint: ["/bin/sh", "./start-microservices.sh"] + volumes: + - ./upload:/usr/src/app/upload + env_file: + - .env + environment: + - NODE_ENV=production + depends_on: + - redis + - database + restart: always + networks: + - internal + + immich-machine-learning: + image: altran1502/immich-machine-learning:release + entrypoint: ["/bin/sh", "./entrypoint.sh"] + volumes: + - ./upload:/usr/src/app/upload + env_file: + - .env + environment: + - NODE_ENV=production + depends_on: + - database + restart: always + networks: + - internal + + immich-web: + image: altran1502/immich-web:release + entrypoint: ["/bin/sh", "./entrypoint.sh"] + env_file: + - .env + restart: always + networks: + - internal + + redis: + container_name: immich_redis + image: redis:6.2 + restart: always + networks: + - internal + + database: + container_name: immich_postgres + image: postgres:14 + env_file: + - .env + environment: + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_USER: ${DB_USERNAME} + POSTGRES_DB: ${DB_DATABASE_NAME} + PG_DATA: /var/lib/postgresql/data + volumes: + - pgdata:/var/lib/postgresql/data + restart: always + networks: + - internal + + immich-proxy: + container_name: immich_proxy + image: altran1502/immich-proxy:release + logging: + driver: none + depends_on: + - immich-server + restart: always + networks: + - internal + - proxy + +volumes: + pgdata: + +networks: + internal: {} + proxy: + external: true diff --git a/immich/sample.env b/immich/sample.env new file mode 100644 index 0000000..4b43aa1 --- /dev/null +++ b/immich/sample.env @@ -0,0 +1,68 @@ +################################################################################### +# Url +################################################################################### +FQDN=immich.tuservidor.es + +################################################################################### +# Database +################################################################################### + +DB_HOSTNAME=immich_postgres +DB_USERNAME=postgres +DB_PASSWORD=postgres +DB_DATABASE_NAME=immich + +# Optional Database settings: +# DB_PORT=5432 + +################################################################################### +# Redis +################################################################################### + +REDIS_HOSTNAME=immich_redis + +# Optional Redis settings: +# REDIS_PORT=6379 +# REDIS_DBINDEX=0 +# REDIS_PASSWORD= +# REDIS_SOCKET= + +################################################################################### +# Log message level - [simple|verbose] +################################################################################### + +LOG_LEVEL=simple + +################################################################################### +# JWT SECRET +################################################################################### + +# This JWT_SECRET is used to sign the authentication keys for user login +# You should set it to a long randomly generated value +# You can use this command to generate one: openssl rand -base64 128 +JWT_SECRET=mXSsFf7gl/g1uw8ZMn9EoN2J2TxfAeGtWUu5RBwtmvPtlln17VQw9/XxVhjsAuDp9Rk1r/i4xHf3BQM8PeCpnCD8/8L0MUzxRK0+OqiurRDXxW7dQWJIZyo9TZkGOE5kX+H/TMDOiHwEEICVdCj4lf+Vm8ADLCAjtshaKq+exng= + +################################################################################### +# Reverse Geocoding +#################################################################################### + +# DISABLE_REVERSE_GEOCODING=false + +# Reverse geocoding is done locally which has a small impact on memory usage +# This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable +# This ranges from 0-3 with 3 being the most precise +# 3 - Cities > 500 population: ~200MB RAM +# 2 - Cities > 1000 population: ~150MB RAM +# 1 - Cities > 5000 population: ~80MB RAM +# 0 - Cities > 15000 population: ~40MB RAM + +# REVERSE_GEOCODING_PRECISION=3 + +#################################################################################### +# WEB - Optional +#################################################################################### + +# Custom message on the login page, should be written in HTML form. +# For example PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.

Email: demo@demo.de
Password: demo" + +PUBLIC_LOGIN_PAGE_MESSAGE=