Initial commit: Immich config with real .env

This commit is contained in:
2026-02-27 21:16:08 -06:00
commit a1e3e72329
4 changed files with 155 additions and 0 deletions

7
.env Normal file
View File

@@ -0,0 +1,7 @@
UPLOAD_LOCATION=/home/clint/archive/systems/containers/immich/
DB_DATA_LOCATION=/home/clint/containers/immich/postgres
TZ=America/Chicago
IMMICH_VERSION=v2
DB_PASSWORD=Xb1Y4MPIbVZdlK
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
cache/
postgres/

95
README.md Normal file
View File

@@ -0,0 +1,95 @@
# Immich
Self-hosted photo and video management server running on box-stableapps (192.168.69.4). Managed by Coolify as a service on the localhost server.
## Server Details
| | |
|---|---|
| Host | 192.168.69.4 (box-stableapps) |
| Coolify service UUID | `t4cg4wk480w4ck0so0og4wgk` |
| Coolify project | stable-apps |
| Image | ghcr.io/immich-app/immich-server:v2 |
| Web UI port | 2001 (container 2283) |
| Web UI | https://immich.clintmasden.duckdns.org |
| SSH | `ssh clint@192.168.69.4` (password: `this-bo%-180391`) |
## Containers
| Container | Image | Port | Purpose |
|-----------|-------|------|---------|
| immich_server | ghcr.io/immich-app/immich-server:v2 | 2001:2283 | Main app server |
| immich_machine_learning | ghcr.io/immich-app/immich-machine-learning:v2 | internal | Face/object detection |
| immich_redis | valkey/valkey:9 | internal | Cache |
| immich_postgres | ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0 | internal | Database with vector extensions |
## Volumes
| Host Path | Container Path | Type | Notes |
|-----------|---------------|------|-------|
| `/home/clint/archive/systems/containers/immich/` | `/data` | CIFS mount | Upload data (photos, thumbs, encoded video) |
| `/home/clint/archive` | `/archive` | CIFS mount (ro) | Read-only external library browsing |
| `/home/clint/containers/immich/postgres` | `/var/lib/postgresql/data` | Local ext4 | **MUST be local disk, NOT SMB** (owned uid 999) |
| `/home/clint/containers/immich/cache` | `/cache` | Local ext4 | ML model cache |
| `/etc/localtime` | `/etc/localtime` | Bind (ro) | Timezone |
## Credentials
| What | Value |
|------|-------|
| DB_USERNAME | `postgres` |
| DB_PASSWORD | `Xb1Y4MPIbVZdlK` |
| DB_DATABASE_NAME | `immich` |
| IMMICH_VERSION | `v2` |
## CIFS Mount Dependency
Upload data and archive browsing require the CIFS mount:
```
# /etc/fstab entry
//192.168.69.2/archive /home/clint/archive cifs rw,credentials=/etc/samba_credentials,iocharset=utf8,vers=3.0,uid=1000,gid=1000,dir_mode=0775,file_mode=0775,_netdev 0 0
```
## Important Notes
- Postgres data directory is owned by uid 999 (postgres container user). Do NOT chown.
- Postgres requires `shm_size: 128mb` for vector operations.
- Postgres image is a custom build with vectorchord + pgvectors extensions — not standard postgres.
- Healthchecks must use `127.0.0.1` not `localhost` (Alpine IPv6 resolves localhost to ::1).
- Upload data on CIFS contains: `backups/`, `encoded-video/`, `library/`, `profile/`, `thumbs/`, `upload/`.
## Deployment
Managed by Coolify. Start/stop via Coolify UI or API:
```bash
# Start
curl -X POST http://192.168.69.4:2010/api/v1/services/t4cg4wk480w4ck0so0og4wgk/start \
-H "Authorization: Bearer <token>"
# Stop
curl -X POST http://192.168.69.4:2010/api/v1/services/t4cg4wk480w4ck0so0og4wgk/stop \
-H "Authorization: Bearer <token>"
```
## Disaster Recovery
If Coolify is lost but data survives:
```bash
cd /home/clint/containers/immich
sudo docker compose up -d
```
This standalone compose + .env will start Immich with the same config. Traefik routing would need to be re-added.
## Backup Locations
| Data | Location |
|------|----------|
| Config backup | `/home/clint/containers/immich.backup/` |
| Original compose | `/home/clint/containers/immich.backup/docker-compose.yml.original` |
| Original .env | `/home/clint/containers/immich.backup/.env.original` |
| Postgres data | Local disk at `/home/clint/containers/immich/postgres` |
| Photo data | On NAS at `//192.168.69.2/archive` |

51
docker-compose.yml Normal file
View File

@@ -0,0 +1,51 @@
name: immich
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
volumes:
- ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro
- /home/clint/archive:/archive:ro
env_file:
- .env
ports:
- "2001:2283"
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
volumes:
- ./cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/valkey/valkey:9
healthcheck:
test: ["CMD-SHELL", "redis-cli ping || exit 1"]
restart: always
database:
container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: "--data-checksums"
volumes:
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
shm_size: 128mb
restart: always