Skip to main content

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

  1. wiki is the user-facing service — public HTTP. Replace ports: ["8080:3000"] with fibe.gg/expose: external:3000 (container port, not host).
  2. db is internal-only — remove ports: if any; talk via service-name DNS (db:5432).
  3. Hardcoded wikijsrocks password is unsafe — convert to a random: true variable.
  4. DB_NAME=wiki and other constants — keep hardcoded.
  5. Add x-fibe.gg.metadata — description, category.
  6. Add x-fibe.gg.variables — subdomain, replicas (optional), DB password.
  7. No build: — both images are pre-built, so this is a fully static template.
  8. No fibe.gg/repo_url anywhere — 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

BeforeAfterWhy
ports: ["8080:3000"] on wikifibe.gg/expose: external:3000Fibe routes via Traefik on subdomain, not host port
POSTGRES_PASSWORD: wikijsrocksPOSTGRES_PASSWORD: placeholder + path bindingGenerated per-launch random secret
DB_PASS: wikijsrocksDB_PASS: placeholder + path bindingSame random as DB password
depends_on: - db (short form)depends_on: db: { condition: service_healthy } + healthcheck: on dbApp waits until DB accepts connections
volumes: - db-data:... (hyphen)db_data (underscore)YAML safety; both work but _ is conventional
No metadatax-fibe.gg.metadata.{description,category}Pantry/launcher card
No subdomainfibe.gg/subdomain: $$var__SUBDOMAINLauncher 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.

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.