Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nodebb service #4624

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions public/svgs/nodebb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions templates/compose/nodebb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ignore: false
privlol marked this conversation as resolved.
Show resolved Hide resolved
# documentation: https://docs.nodebb.org/
# slogan: A next-generation discussion platform.
# tags: communication, forums, discussion
# logo: svgs/nodebb.svg
# port: 4567

services:
nodebb:
image: ghcr.io/nodebb/nodebb:latest
restart: unless-stopped
environment:
- SERVICE_FQDN_nodebb_4567
privlol marked this conversation as resolved.
Show resolved Hide resolved
volumes:
- nodebb-build:/usr/src/app/build
- nodebb-uploads:/usr/src/app/public/uploads
- nodebb-config:/opt/config
- type: bind
source: ./.docker/config/setup.json
target: /usr/src/app/setup.json
isDirectory: false
content: |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use env variables or better our magic variables and do not hardcode secrets.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NodeBB sadly doesn't have any listed documentation that I can find that uses environment variables. And they require the existence of setup.json. I don't know if this is a problem fully but I created a new entrypoint that overwrites the existing setup.json with the magic variables.

{
"defaults": {
"postgres": {
"host": "postgres",
"port": 5432,
"database": "nodebb",
"username": "nodebb",
"password": "nodebb"
}
}
}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4567"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s

postgres:
image: postgres:17.2-alpine
restart: unless-stopped
environment:
privlol marked this conversation as resolved.
Show resolved Hide resolved
POSTGRES_USER: nodebb
POSTGRES_PASSWORD: nodebb
POSTGRES_DB: nodebb
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U nodebb", "-d", "nodebb" ]
interval: 5s
retries: 10
timeout: 2s

volumes:
privlol marked this conversation as resolved.
Show resolved Hide resolved
postgres-data:
nodebb-build:
nodebb-uploads:
nodebb-config: