coolify/templates/compose/nodebb.yaml

56 lines
1.5 KiB
YAML
Raw Permalink Normal View History

2024-12-18 20:29:00 +00:00
# documentation: https://docs.nodebb.org/
# slogan: A next-generation discussion platform.
# category: messaging
2024-12-18 20:29:00 +00:00
# tags: communication, forums, discussion
# logo: svgs/nodebb.svg
# port: 4567
services:
nodebb:
image: ghcr.io/nodebb/nodebb:latest
environment:
- SERVICE_URL_NODEBB_4567
2024-12-18 20:29:00 +00:00
volumes:
2025-01-14 11:59:52 +00:00
- nodebb_build:/usr/src/app/build
- nodebb_uploads:/usr/src/app/public/uploads
- nodebb_config:/opt/config
2024-12-21 20:32:57 +00:00
command: >
/bin/bash -c "
cat > /usr/src/app/setup.json <<EOL
{
\"defaults\": {
\"postgres\": {
\"host\": \"postgres\",
\"port\": 5432,
\"database\": \"nodebb\",
\"username\": \"${SERVICE_USER_POSTGRES}\",
\"password\": \"${SERVICE_PASSWORD_POSTGRES}\"
2024-12-18 20:29:00 +00:00
}
}
2024-12-21 20:32:57 +00:00
}
EOL
&& tini -- entrypoint.sh
"
2025-01-14 11:59:52 +00:00
depends_on:
postgres:
condition: service_healthy
2024-12-18 20:29:00 +00:00
healthcheck:
2025-01-14 11:59:52 +00:00
test: ["CMD-SHELL", "bash -c ':> /dev/tcp/127.0.0.1/4567' || exit 1"]
interval: 5s
timeout: 20s
2024-12-18 20:29:00 +00:00
retries: 3
postgres:
image: postgres:17.2-alpine
environment:
2025-01-14 11:59:52 +00:00
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
- POSTGRES_DB=nodebb
2024-12-18 20:29:00 +00:00
volumes:
2025-01-14 11:59:52 +00:00
- nodebb_postgres_data:/var/lib/postgresql/data
2024-12-18 20:29:00 +00:00
healthcheck:
2025-01-14 11:59:52 +00:00
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
2024-12-18 20:29:00 +00:00
interval: 5s
2025-01-14 11:59:52 +00:00
timeout: 20s
2024-12-18 20:29:00 +00:00
retries: 10