Deutsch
Loslegen
← Alle Vorlagen

NodeBB mit einem Klick auf Pethost deployen

Ein Forum für deine Community

Was passiert

  1. Du meldest dich bei Pethost an oder legst ein Konto an, mit Passkey, GitHub oder Google.
  2. Noch keine Maschine? Du wählst einen Tarif, und wir bereiten eine für dich vor. Der Link wartet in deinem Browser, bis sie bereit ist.
  3. „Neues Projekt“ öffnet sich bei der App. Du füllst aus, was sie braucht, und klickst auf „Projekt erstellen“: Admin-Passwort.
  4. In ein, zwei Minuten läuft die App unter eigener Adresse mit HTTPS. Ihre Secrets werden zufällig für sie erzeugt, und ihre Daten sind im nächtlichen Backup.
  5. Sie ist ein Projekt wie jedes andere: compose.yaml, .env, Logs und ein Terminal findest du im Panel, und dein Agent kann sie ändern, zurückrollen oder wiederherstellen.

Erste Schritte

Melde dich als admin mit dem Passwort an, das du festgelegt hast; der erste Start baut das Forum auf und dauert einige Minuten. Alle dürfen sich registrieren: Wer beitreten darf, legst du unter „Admin > Settings > Users“ fest. E-Mails, auch das Zurücksetzen von Passwörtern, funktionieren, sobald unter „Admin > Settings > Email“ ein SMTP-Server eingetragen ist.

Was läuft

Die Vorlage ist diese compose.yaml und die Variablen, die sie in die .env des Projekts schreibt. Pethost führt die Datei so aus, wie sie geschrieben ist.

services:
  nodebb:
    image: ghcr.io/nodebb/nodebb:4.x
    restart: unless-stopped
    # The first start installs the forum with this admin, so the web installer the image would
    # open to whoever comes first never runs: without config.json the container exits instead.
    # NodeBB asks a terminal again for a password it refuses, so the setup has a time limit.
    entrypoint:
      - tini
      - --
      - sh
      - -ec
      - |
        if [ ! -f /opt/config/installed ]; then
          setup='{"trust_proxy": 1}' timeout 300 /usr/src/app/nodebb setup --config=/opt/config/config.json --skip-build
          test -f /opt/config/config.json
          touch /opt/config/installed
        fi
        test -f /opt/config/config.json
        exec entrypoint.sh
    environment:
      NODEBB_URL: ${URL}
      NODEBB_DB: redis
      NODEBB_DB_HOST: redis
      NODEBB_ADMIN_USERNAME: admin
      NODEBB_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      # Setup needs an address; it is stored as confirmed, and no mail is sent to it.
      NODEBB_ADMIN_EMAIL: [email protected]
    depends_on:
      redis:
        condition: service_healthy
    # Every folder the image declares as a volume; node_modules keeps the plugins installed later.
    volumes:
      - config:/opt/config
      - uploads:/usr/src/app/public/uploads
      - build:/usr/src/app/build
      - node_modules:/usr/src/app/node_modules

  # The forum's only database: every write goes to the append-only file.
  redis:
    image: redis:8-alpine
    restart: unless-stopped
    command: [redis-server, --appendonly, "yes", --loglevel, warning]
    volumes:
      - redis:/data
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping | grep -q PONG"]
      interval: 5s
      timeout: 3s
      retries: 12

volumes:
  config:
  uploads:
  build:
  node_modules:
  redis: