|
1 | | -# immich-postgres |
| 1 | +# Immich PostgreSQL |
2 | 2 |
|
3 | | -PostgreSQL 14 with pgvector + VectorChord for [Immich](https://immich.app/). |
| 3 | +PostgreSQL 14 with pgvector/pgvecto.rs extensions for Immich. |
4 | 4 |
|
5 | | -!!! note "Part of the Immich Stack" |
6 | | - This is just one component of Immich. For the complete setup (docker-compose, configuration, etc.), please see the [Daemonless Immich Stack](https://github.com/daemonless/immich). |
| 5 | +| | | |
| 6 | +|---|---| |
| 7 | +| **Port** | 5432 | |
| 8 | +| **Registry** | `ghcr.io/daemonless/immich-postgres` | |
| 9 | +| **Source** | [https://github.com/immich-app/immich](https://github.com/immich-app/immich) | |
| 10 | +| **Website** | [https://immich.app/](https://immich.app/) | |
7 | 11 |
|
8 | | -Drop-in compatible with official Immich PostgreSQL image. |
| 12 | +## Deployment |
9 | 13 |
|
10 | | -## Environment Variables |
11 | | - |
12 | | -| Variable | Description | Default | |
13 | | -|----------|-------------|---------| |
14 | | -| `POSTGRES_USER` | Database superuser name | `postgres` | |
15 | | -| `POSTGRES_PASSWORD` | Superuser password | `postgres` | |
16 | | -| `POSTGRES_DB` | Default database to create | `immich` | |
17 | | -| `PGDATA` | Data directory location | `/config/data` | |
18 | | - |
19 | | -## Quick Start |
20 | | - |
21 | | -```bash |
22 | | -podman run -d --name immich-postgres \ |
23 | | - --annotation 'org.freebsd.jail.allow.sysvipc=true' \ |
24 | | - -p 5432:5432 \ |
25 | | - -e POSTGRES_PASSWORD=postgres \ |
26 | | - -e POSTGRES_DB=immich \ |
27 | | - -v /containers/immich/postgres:/config \ |
28 | | - ghcr.io/daemonless/immich-postgres:latest |
29 | | -``` |
30 | | - |
31 | | -**Note:** The `org.freebsd.jail.allow.sysvipc=true` annotation is required for PostgreSQL shared memory. This requires a patched version of `ocijail`. See the [ocijail patch guide](https://daemonless.io/guides/ocijail-patch/) for build instructions. |
32 | | - |
33 | | -## podman-compose |
| 14 | +### Podman Compose |
34 | 15 |
|
35 | 16 | ```yaml |
36 | 17 | services: |
37 | 18 | immich-postgres: |
38 | 19 | image: ghcr.io/daemonless/immich-postgres:latest |
39 | 20 | container_name: immich-postgres |
40 | 21 | environment: |
| 22 | + - POSTGRES_USER=postgres |
41 | 23 | - POSTGRES_PASSWORD=postgres |
42 | 24 | - POSTGRES_DB=immich |
43 | 25 | volumes: |
44 | | - - /data/config/postgres:/config |
| 26 | + - /path/to/containers/immich-postgres/var/lib/postgresql/data:/var/lib/postgresql/data |
45 | 27 | ports: |
46 | 28 | - 5432:5432 |
47 | | - annotations: |
48 | | - org.freebsd.jail.allow.sysvipc: "true" |
49 | 29 | restart: unless-stopped |
50 | 30 | ``` |
51 | 31 |
|
52 | | -## Tags |
| 32 | +### Podman CLI |
53 | 33 |
|
54 | | -| Tag | Source | Description | |
55 | | -|-----|--------|-------------| |
56 | | -| `:latest` | `databases/postgresql14-server` | FreeBSD latest packages (Alias for :pkg-latest) | |
57 | | -| `:pkg` | `databases/postgresql14-server` | FreeBSD quarterly packages | |
58 | | -| `:pkg-latest` | `databases/postgresql14-server` | FreeBSD latest packages | |
| 34 | +```bash |
| 35 | +podman run -d --name immich-postgres \ |
| 36 | + -p 5432:5432 \ |
| 37 | + -e POSTGRES_USER=postgres \ |
| 38 | + -e POSTGRES_PASSWORD=postgres \ |
| 39 | + -e POSTGRES_DB=immich \ |
| 40 | + -v /path/to/containers/immich-postgres/var/lib/postgresql/data:/var/lib/postgresql/data \ |
| 41 | + ghcr.io/daemonless/immich-postgres:latest |
| 42 | +``` |
| 43 | +Access at: `http://localhost:5432` |
59 | 44 |
|
60 | | -## Volumes |
| 45 | +### Ansible |
61 | 46 |
|
62 | | -| Path | Description | |
63 | | -|------|-------------| |
64 | | -| `/config` | Configuration and data directory (PGDATA is in `/config/data`) | |
| 47 | +```yaml |
| 48 | +- name: Deploy immich-postgres |
| 49 | + containers.podman.podman_container: |
| 50 | + name: immich-postgres |
| 51 | + image: ghcr.io/daemonless/immich-postgres:latest |
| 52 | + state: started |
| 53 | + restart_policy: always |
| 54 | + env: |
| 55 | + POSTGRES_USER: "postgres" |
| 56 | + POSTGRES_PASSWORD: "postgres" |
| 57 | + POSTGRES_DB: "immich" |
| 58 | + ports: |
| 59 | + - "5432:5432" |
| 60 | + volumes: |
| 61 | + - "/path/to/containers/immich-postgres/var/lib/postgresql/data:/var/lib/postgresql/data" |
| 62 | +``` |
65 | 63 |
|
66 | | -## Ports |
| 64 | +## Configuration |
67 | 65 |
|
68 | | -| Port | Description | |
69 | | -|------|-------------| |
70 | | -| 5432 | PostgreSQL | |
| 66 | +### Environment Variables |
71 | 67 |
|
72 | | -## Features |
| 68 | +| Variable | Default | Description | |
| 69 | +|----------|---------|-------------| |
| 70 | +| `POSTGRES_USER` | `postgres` | Database superuser (default: postgres) | |
| 71 | +| `POSTGRES_PASSWORD` | `postgres` | Database password (default: postgres) | |
| 72 | +| `POSTGRES_DB` | `immich` | Database name (default: immich) | |
73 | 73 |
|
74 | | -- **PostgreSQL 14:** Matches official Immich requirements. |
75 | | -- **pgvector:** 0.8.x extension installed (via ports). |
76 | | -- **VectorChord:** 0.4.x extension installed (built from source). |
77 | | -- **Auto-init:** Extensions enabled automatically on database creation. |
| 74 | +### Volumes |
78 | 75 |
|
79 | | -## Extensions |
| 76 | +| Path | Description | |
| 77 | +|------|-------------| |
| 78 | +| `/var/lib/postgresql/data` | Database data directory | |
80 | 79 |
|
81 | | -Extensions are automatically enabled: |
| 80 | +### Ports |
82 | 81 |
|
83 | | -```sql |
84 | | -CREATE EXTENSION IF NOT EXISTS vector; -- pgvector |
85 | | -CREATE EXTENSION IF NOT EXISTS vchord; -- VectorChord |
86 | | -``` |
| 82 | +| Port | Protocol | Description | |
| 83 | +|------|----------|-------------| |
| 84 | +| `5432` | TCP | PostgreSQL Port | |
87 | 85 |
|
88 | 86 | ## Notes |
89 | 87 |
|
90 | | -- **User:** `bsd` (UID/GID set via PUID/PGID, default 1000) |
91 | | -- **Base:** Built on `ghcr.io/daemonless/base-image` (FreeBSD) |
92 | | -- **Migration:** Fully compatible with official Immich Postgres data. |
93 | | - |
94 | | -## Links |
95 | | - |
96 | | -- [Immich](https://immich.app/) |
97 | | -- [PostgreSQL](https://www.postgresql.org/) |
| 88 | +- **User:** `postgres` (UID/GID set via PUID/PGID) |
| 89 | +- **Base:** Built on `ghcr.io/daemonless/base` (FreeBSD) |
0 commit comments