Wikijs
Wiki.js is a Node-based wiki platform. The official docker-compose has two services: db (Postgres) and wiki (Wiki.js). Convert to Fibe end-to-end.
Input (typical Wiki.js docker-compose.yml)
version: "3"
services:
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: wiki
POSTGRES_PASSWORD: wikijsrocks
POSTGRES_USER: wikijs
logging:
driver: "none"
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data
wiki:
image: ghcr.io/requarks/wiki:2
depends_on:
- db
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: wikijs
DB_PASS: wikijsrocks
DB_NAME: wiki
restart: unless-stopped
ports:
- "8080:3000"
volumes:
db-data:
Conversion steps
wikiis the user-facing service — public HTTP. Replaceports: ["8080:3000"]withfibe.gg/expose: external:3000(container port, not host).dbis internal-only — removeports:if any; talk via service-name DNS (db:5432).- Hardcoded
wikijsrockspassword is unsafe — convert to arandom: truevariable. DB_NAME=wikiand other constants — keep hardcoded.- Add
x-fibe.gg.metadata— description, category. - Add
x-fibe.gg.variables— subdomain, replicas (optional), DB password. - No
build:— both images are pre-built, so this is a fully static template. - No
fibe.gg/repo_urlanywhere — no source backing.
Output (Fibe template)
services:
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: wiki
POSTGRES_USER: wikijs
POSTGRES_PASSWORD: placeholder # overwritten by path binding
logging:
driver: "none"
restart: unless-stopped
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wikijs -d wiki"]
interval: 5s
timeout: 5s
retries: 10
start_period: 30s
wiki:
image: ghcr.io/requarks/wiki:2
depends_on:
db:
condition: service_healthy
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: wikijs
DB_NAME: wiki
DB_PASS: placeholder # overwritten by path binding
restart: unless-stopped
labels:
fibe.gg/expose: external:3000
fibe.gg/subdomain: $$var__SUBDOMAIN
volumes:
db_data:
x-fibe.gg:
variables:
SUBDOMAIN:
name: "Subdomain"
required: true
default: "wiki"
validation: "/^[a-z0-9][a-z0-9-]*[a-z0-9]$/"
DB_PASSWORD:
name: "Database password"
required: true
random: true
secret: true
sensitive: true
paths:
- services.db.environment.POSTGRES_PASSWORD
- services.wiki.environment.DB_PASS
metadata:
description: "Wiki.js collaborative documentation server with Postgres"
category: "Productivity"
What changed
| Before | After | Why |
|---|---|---|
ports: ["8080:3000"] on wiki | fibe.gg/expose: external:3000 | Fibe routes via Traefik on subdomain, not host port |
POSTGRES_PASSWORD: wikijsrocks | POSTGRES_PASSWORD: placeholder + path binding | Generated per-launch random secret |
DB_PASS: wikijsrocks | DB_PASS: placeholder + path binding | Same random as DB password |
depends_on: - db (short form) | depends_on: db: { condition: service_healthy } + healthcheck: on db | App waits until DB accepts connections |
volumes: - db-data:... (hyphen) | db_data (underscore) | YAML safety; both work but _ is conventional |
| No metadata | x-fibe.gg.metadata.{description,category} | Pantry/launcher card |
| No subdomain | fibe.gg/subdomain: $$var__SUBDOMAIN | Launcher chooses |
Optional enhancements
Add zero-downtime for the wiki service
Wiki.js can run with multiple replicas. To opt in:
services:
wiki:
deploy:
replicas: 2
labels:
fibe.gg/expose: external:3000
fibe.gg/subdomain: $$var__SUBDOMAIN
fibe.gg/zerodowntime: "true"
fibe.gg/healthcheck_path: /healthz
fibe.gg/healthcheck_interval: 10s
fibe.gg/healthcheck_timeout: 5s
fibe.gg/healthcheck_retries: "5"
fibe.gg/healthcheck_start_period: 60s
(Wiki.js exposes /healthz on the same port.)
Variable-driven image tag
services:
wiki:
image: ghcr.io/requarks/wiki:$$var__WIKI_VERSION
x-fibe.gg:
variables:
WIKI_VERSION:
name: "Wiki.js version"
default: "2"
validation: "/^[A-Za-z0-9_.-]+$/"
Object storage for uploads (production)
Wiki.js supports S3-compatible storage for assets. Add envs:
services:
wiki:
environment:
UPLOADS_STORAGE: s3
S3_ENDPOINT: $$var__S3_ENDPOINT
S3_ACCESS_KEY_ID: $$var__S3_KEY
S3_SECRET_ACCESS_KEY: $$var__S3_SECRET
S3_BUCKET: $$var__S3_BUCKET
x-fibe.gg:
variables:
S3_ENDPOINT:
name: "S3 endpoint URL"
required: false
S3_KEY:
name: "S3 access key"
secret: true
S3_SECRET:
name: "S3 secret"
secret: true
sensitive: true
S3_BUCKET:
name: "S3 bucket"
default: "wiki-uploads"
Validate
fibe_schema(
resource: "compose",
operation: "validate",
payload: {
"compose_yaml": "<the template above>"
}
)
Schema passes. Runtime validation accepts. Launch via fibe_templates_launch.
Related skills
playbook-postgres-app, recipe-ports-to-expose, recipe-random-and-secrets, recipe-add-subdomain, recipe-named-volumes, recipe-depends-on, recipe-add-metadata, convert-compose-to-fibe.