Add immich

This commit is contained in:
2025-08-09 13:26:23 +00:00
parent 78e524d61c
commit 258c204163
9 changed files with 140 additions and 0 deletions

View File

@@ -40,3 +40,9 @@ GLANCE_KEY=
GHOST_DOMAIN= GHOST_DOMAIN=
GHOST_CRT= GHOST_CRT=
GHOST_KEY= GHOST_KEY=
############# Immich #############
IMMICH_DOMAIN=
IMMICH_CRT=
IMMICH_KEY=

View File

@@ -153,6 +153,24 @@
} }
} }
############## immich ##############
{$IMMICH_DOMAIN} {
tls /etc/ssl/custom/{$IMMICH_CRT} /etc/ssl/custom/{$IMMICH_KEY}
request_body {
max_size 1024MB
}
reverse_proxy http://immich_server:2283 {
header_up X-Real-IP {http.request.header.Cf-Connecting-Ip}
header_up X-Forwarded-For {http.request.header.Cf-Connecting-Ip}
header_up X-Country-Code {http.request.header.Cf-Ipcountry}
header_up X-Forwarded-Proto {http.request.scheme}
header_up Host {http.request.host}
header_up -CF-*
}
}
import Caddyfile.private import Caddyfile.private

BIN
glance/assets/immich.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -32,6 +32,9 @@
- title: wg.aykhans.me - title: wg.aykhans.me
url: https://wg.aykhans.me/ url: https://wg.aykhans.me/
icon: /assets/wireguard.png icon: /assets/wireguard.png
- title: photos.aykhans.me
url: https://photos.aykhans.me/
icon: /assets/immich.png
- title: aykhans.me - title: aykhans.me
url: https://aykhans.me/ url: https://aykhans.me/
icon: /assets/ghost.png icon: /assets/ghost.png

12
immich/.env.example Normal file
View File

@@ -0,0 +1,12 @@
# The location where your uploaded files are stored
UPLOAD_LOCATION=./data/server
# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=./data/postgres
DB_PASSWORD=postgres
# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

2
immich/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/data/*
!.gitkeep

0
immich/data/.gitkeep Normal file
View File

80
immich/docker-compose.yml Normal file
View File

@@ -0,0 +1,80 @@
networks:
immich:
external: false
caddy:
name: caddy
driver: bridge
external: true
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:release
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- "2283:2283"
depends_on:
- redis
- database
networks:
- immich
- caddy
deploy:
resources:
limits:
cpus: "1.5"
memory: 1G
restart: unless-stopped
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:release
volumes:
- model-cache:/cache
env_file:
- .env
networks:
- immich
# deploy:
# resources:
# limits:
# cpus: "1"
# memory: 600M
restart: unless-stopped
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/valkey/valkey:8-bookworm@sha256:facc1d2c3462975c34e10fccb167bfa92b0e0dbd992fc282c29a61c3243afb11
networks:
- immich
healthcheck:
test: redis-cli ping || exit 1
restart: unless-stopped
database:
container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: "--data-checksums"
networks:
- immich
volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
shm_size: 128mb
restart: unless-stopped
volumes:
model-cache:

19
main.sh
View File

@@ -61,6 +61,7 @@ generate_env_files() {
cp --update=none ./caddy/.env.example ./caddy/.env cp --update=none ./caddy/.env.example ./caddy/.env
cp --update=none ./glance/.env.example ./glance/.env cp --update=none ./glance/.env.example ./glance/.env
cp --update=none ./ghost/.env.example ./ghost/.env cp --update=none ./ghost/.env.example ./ghost/.env
cp --update=none ./immich/.env.example ./immich/.env
cp --update=none ./caddy/Caddyfile.private.example ./caddy/Caddyfile.private cp --update=none ./caddy/Caddyfile.private.example ./caddy/Caddyfile.private
# cp --update=none ./slash/.env.example ./slash/.env # cp --update=none ./slash/.env.example ./slash/.env
# cp --update=none ./grafana/.env.example ./grafana/.env # cp --update=none ./grafana/.env.example ./grafana/.env
@@ -172,6 +173,15 @@ start_services() {
exit 1 exit 1
fi fi
echo "Starting immich..."
$DOCKER_COMPOSE_COMMAND -f ./immich/docker-compose.yml up -d
if [ $? -eq 0 ]; then
print_success "Immich started successfully."
else
print_error "failed to start Immich!"
exit 1
fi
echo "Starting caddy..." echo "Starting caddy..."
$DOCKER_COMPOSE_COMMAND -f ./caddy/docker-compose.yml up -d $DOCKER_COMPOSE_COMMAND -f ./caddy/docker-compose.yml up -d
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@@ -282,6 +292,15 @@ stop_services() {
exit 1 exit 1
fi fi
echo "Stopping immich..."
$DOCKER_COMPOSE_COMMAND -f ./immich/docker-compose.yml down
if [ $? -eq 0 ]; then
print_success "Immich stopped successfully."
else
print_error "failed to stop Immich!"
exit 1
fi
echo "Stopping caddy..." echo "Stopping caddy..."
$DOCKER_COMPOSE_COMMAND -f ./caddy/docker-compose.yml down $DOCKER_COMPOSE_COMMAND -f ./caddy/docker-compose.yml down
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then