Skip to content

Commit 168e661

Browse files
committed
setup pkg/pkg-latest builds, github workflow, and docs
1 parent 6def34c commit 168e661

4 files changed

Lines changed: 97 additions & 81 deletions

File tree

.github/workflows/build.yml

Lines changed: 8 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,16 @@
1-
name: Build and Push
1+
name: Build FreeBSD Container
22

33
on:
44
push:
55
branches: [main]
6-
paths-ignore:
7-
- '*.md'
8-
- 'docs/**'
9-
- 'LICENSE'
10-
- '.gitignore'
6+
paths-ignore: ['*.md', 'LICENSE', '.gitignore']
7+
pull_request:
8+
branches: [main]
119
workflow_dispatch:
1210

13-
env:
14-
REGISTRY: ghcr.io
15-
IMAGE_NAME: ${{ github.repository }}
16-
1711
jobs:
1812
build:
19-
runs-on: ubuntu-latest
20-
permissions:
21-
contents: read
22-
packages: write
23-
24-
steps:
25-
- name: Checkout repository
26-
uses: actions/checkout@v4
27-
28-
- name: Log in to Container Registry
29-
uses: docker/login-action@v3
30-
with:
31-
registry: ${{ env.REGISTRY }}
32-
username: ${{ github.actor }}
33-
password: ${{ secrets.GITHUB_TOKEN }}
34-
35-
- name: Extract metadata
36-
id: meta
37-
uses: docker/metadata-action@v5
38-
with:
39-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
40-
tags: |
41-
type=raw,value=latest,enable={{is_default_branch}}
42-
type=sha,prefix=
43-
44-
# Note: This is a FreeBSD container - actual builds happen on Woodpecker CI
45-
# This workflow validates the Containerfile and updates GitHub metadata
46-
- name: Validate Containerfile
47-
run: |
48-
echo "Validating Containerfile syntax..."
49-
if grep -q "^FROM" Containerfile; then
50-
echo "Containerfile appears valid"
51-
else
52-
echo "Error: No FROM instruction found"
53-
exit 1
54-
fi
55-
56-
- name: Update repo description
57-
uses: actions/github-script@v7
58-
if: github.event_name == 'push'
59-
continue-on-error: true
60-
with:
61-
script: |
62-
github.rest.repos.update({
63-
owner: context.repo.owner,
64-
repo: context.repo.repo,
65-
description: "PostgreSQL 14 with pgvector + VectorChord for Immich (FreeBSD)",
66-
homepage: "https://immich.app"
67-
})
13+
uses: daemonless/daemonless/.github/workflows/build-app.yml@main
14+
with:
15+
image_name: immich-postgres
16+
secrets: inherit

.woodpecker.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Woodpecker CI configuration for Immich PostgreSQL
22

33
steps:
4-
- name: build-latest
4+
- name: build-pkg
55
image: /bin/sh
66
environment:
77
GITHUB_TOKEN:
@@ -12,14 +12,43 @@ steps:
1212
- |
1313
mkdir -p scripts
1414
fetch -qo scripts/build.sh \
15-
"https://raw.githubusercontent.com/daemonless/daemonless/build-v1.1.1/scripts/build.sh"
15+
"https://raw.githubusercontent.com/daemonless/daemonless/build-v1.2.0/scripts/build.sh"
1616
chmod +x scripts/build.sh
1717
./scripts/build.sh \
1818
--doas \
1919
--registry ghcr.io \
2020
--image ghcr.io/daemonless/immich-postgres \
21-
--tag latest \
21+
--containerfile Containerfile \
22+
--base-version 15-quarterly \
23+
--tag pkg \
2224
--tag-version \
25+
--version-suffix "-pkg" \
26+
--skip-wip \
27+
--login --push
28+
29+
- name: build-pkg-latest
30+
image: /bin/sh
31+
environment:
32+
GITHUB_TOKEN:
33+
from_secret: GITHUB_TOKEN
34+
GITHUB_ACTOR:
35+
from_secret: GITHUB_USER
36+
commands:
37+
- |
38+
mkdir -p scripts
39+
fetch -qo scripts/build.sh \
40+
"https://raw.githubusercontent.com/daemonless/daemonless/build-v1.2.0/scripts/build.sh"
41+
chmod +x scripts/build.sh
42+
./scripts/build.sh \
43+
--doas \
44+
--registry ghcr.io \
45+
--image ghcr.io/daemonless/immich-postgres \
46+
--containerfile Containerfile \
47+
--base-version 15 \
48+
--tag pkg-latest \
49+
--tag-version \
50+
--version-suffix "-pkg-latest" \
51+
--alias latest \
2352
--skip-wip \
2453
--login --push
2554

Containerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ LABEL org.opencontainers.image.title="Immich PostgreSQL" \
5252
io.daemonless.arch="${FREEBSD_ARCH}" \
5353
io.daemonless.config-mount="/config" \
5454
io.daemonless.category="Database" \
55+
io.daemonless.pkg-source="containerfile" \
5556
io.daemonless.packages="${PACKAGES}"
5657

5758
# Install PostgreSQL, then remove LLVM JIT (saves ~2GB, JIT not needed for Immich)
5859
RUN pkg update && \
5960
pkg install -y ${PACKAGES} && \
61+
mkdir -p /app && pkg info postgresql14-server | sed -n 's/.*Version.*: *//p' > /app/version && \
6062
pkg delete -fy llvm19 perl5 python311 || true && \
6163
pkg autoremove -y || true && \
6264
pkg clean -ay && \

README.md

Lines changed: 55 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
# Immich PostgreSQL for FreeBSD
1+
# immich-postgres
22

33
PostgreSQL 14 with pgvector + VectorChord for [Immich](https://immich.app/).
44

55
Drop-in compatible with official Immich PostgreSQL image.
66

7-
## Features
7+
## Environment Variables
88

9-
- PostgreSQL 14 (matches official Immich)
10-
- pgvector 0.8.x extension
11-
- VectorChord 0.4.x extension
12-
- Auto-initialization on first run
9+
| Variable | Description | Default |
10+
|----------|-------------|---------|
11+
| `POSTGRES_USER` | Database superuser name | `postgres` |
12+
| `POSTGRES_PASSWORD` | Superuser password | `postgres` |
13+
| `POSTGRES_DB` | Default database to create | `immich` |
14+
| `PGDATA` | Data directory location | `/config/data` |
1315

14-
## Usage
16+
## Quick Start
1517

1618
```bash
1719
podman run -d --name immich-postgres \
1820
--annotation 'org.freebsd.jail.allow.sysvipc=true' \
21+
-p 5432:5432 \
1922
-e POSTGRES_PASSWORD=postgres \
2023
-e POSTGRES_DB=immich \
2124
-v /containers/immich/postgres:/config \
@@ -24,21 +27,51 @@ podman run -d --name immich-postgres \
2427

2528
**Note:** The `org.freebsd.jail.allow.sysvipc=true` annotation is required for PostgreSQL shared memory.
2629

27-
## Environment Variables
30+
## podman-compose
31+
32+
```yaml
33+
services:
34+
immich-postgres:
35+
image: ghcr.io/daemonless/immich-postgres:latest
36+
container_name: immich-postgres
37+
environment:
38+
- POSTGRES_PASSWORD=postgres
39+
- POSTGRES_DB=immich
40+
volumes:
41+
- /data/config/postgres:/config
42+
ports:
43+
- 5432:5432
44+
annotations:
45+
org.freebsd.jail.allow.sysvipc: "true"
46+
restart: unless-stopped
47+
```
2848
29-
| Variable | Default | Description |
30-
|----------|---------|-------------|
31-
| POSTGRES_USER | postgres | Database superuser name |
32-
| POSTGRES_PASSWORD | postgres | Superuser password |
33-
| POSTGRES_DB | immich | Default database to create |
49+
## Tags
50+
51+
| Tag | Source | Description |
52+
|-----|--------|-------------|
53+
| `:latest` | `databases/postgresql14-server` | FreeBSD latest packages (Alias for :pkg-latest) |
54+
| `:pkg` | `databases/postgresql14-server` | FreeBSD quarterly packages |
55+
| `:pkg-latest` | `databases/postgresql14-server` | FreeBSD latest packages |
3456

3557
## Volumes
3658

37-
- `/config` - Data directory (PGDATA)
59+
| Path | Description |
60+
|------|-------------|
61+
| `/config` | Configuration and data directory (PGDATA is in `/config/data`) |
3862

3963
## Ports
4064

41-
- `5432` - PostgreSQL
65+
| Port | Description |
66+
|------|-------------|
67+
| 5432 | PostgreSQL |
68+
69+
## Features
70+
71+
- **PostgreSQL 14:** Matches official Immich requirements.
72+
- **pgvector:** 0.8.x extension installed (via ports).
73+
- **VectorChord:** 0.4.x extension installed (built from source).
74+
- **Auto-init:** Extensions enabled automatically on database creation.
4275

4376
## Extensions
4477

@@ -49,10 +82,13 @@ CREATE EXTENSION IF NOT EXISTS vector; -- pgvector
4982
CREATE EXTENSION IF NOT EXISTS vchord; -- VectorChord
5083
```
5184

52-
## Migration
85+
## Notes
5386

54-
Your existing Immich PostgreSQL data directory works as-is. Both official and daemonless use PostgreSQL 14 with VectorChord.
87+
- **User:** `bsd` (UID/GID set via PUID/PGID, default 1000)
88+
- **Base:** Built on `ghcr.io/daemonless/base-image` (FreeBSD)
89+
- **Migration:** Fully compatible with official Immich Postgres data.
5590

56-
## Part of Immich for FreeBSD
91+
## Links
5792

58-
See [daemonless/immich](https://github.com/daemonless/immich) for the complete stack.
93+
- [Immich](https://immich.app/)
94+
- [PostgreSQL](https://www.postgresql.org/)

0 commit comments

Comments
 (0)