scripts/lech/docker/immich.sh

76 lines
2.3 KiB
Bash
Raw Normal View History

2024-09-02 16:53:27 -04:00
#!/bin/bash
set -e
2024-12-16 20:33:10 -05:00
. $HOME/scripts-private/lech/immich.env
VERSION=$(curl --silent https://api.github.com/repos/immich-app/immich/releases | grep "\"tag_name\": \"$MINOR_VERSION" | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')
echo
echo "VERSION: $VERSION"
2024-09-02 16:53:27 -04:00
up () {
# Exposed on port 3001 in pew-net
docker run \
--detach \
--name immich-server \
--restart unless-stopped \
--env DB_DATABASE_NAME=immich_db \
--env DB_HOSTNAME=immich-pg \
--env DB_USERNAME=immich_user \
--env DB_PASSWORD=immich_pw \
--env IMMICH_MACHINE_LEARNING_URL=http://immich-ml:3003 \
--env REDIS_HOSTNAME=immich-redis \
--volume /mammoth/immich/upload:/usr/src/app/upload:rw \
--volume /mammoth/photos:/external_library/photos:ro \
--volume /etc/localtime:/etc/localtime:ro \
--network pew-net \
2024-12-16 20:33:10 -05:00
ghcr.io/immich-app/immich-server:$VERSION
2024-09-02 16:53:27 -04:00
docker run \
--detach \
--name immich-ml \
--restart unless-stopped \
--env DB_DATABASE_NAME=immich_db \
--env DB_HOSTNAME=immich-pg \
--env DB_USERNAME=immich_user \
--env DB_PASSWORD=immich_pw \
--env IMMICH_MACHINE_LEARNING_URL=http://immich-ml:3003 \
--env REDIS_HOSTNAME=immich-redis \
--volume /mammoth/immich/cache:/cache:rw \
--network pew-net \
2024-12-16 20:33:10 -05:00
ghcr.io/immich-app/immich-machine-learning:$VERSION
2024-09-02 16:53:27 -04:00
docker run \
--detach \
--name immich-redis \
--restart unless-stopped \
--network pew-net \
docker.io/redis:6
docker run \
--detach \
--name immich-pg \
--restart unless-stopped \
--env POSTGRES_PASSWORD=immich_pw \
--env POSTGRES_USER=immich_user \
--env POSTGRES_DB=immich_db \
--env POSTGRES_INITDB_ARGS=--data-checksums \
--volume /mammoth/immich/postgres:/var/lib/postgresql/data:rw \
--network pew-net \
2024-12-16 20:33:10 -05:00
docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0 \
2024-09-02 16:53:27 -04:00
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
}
down () {
docker stop immich-server || true
docker rm immich-server || true
docker stop immich-ml || true
docker rm immich-ml || true
docker stop immich-redis || true
docker rm immich-redis || true
docker stop immich-pg || true
docker rm immich-pg || true
}
$@