coolify/templates/compose/nodebb.yaml

54 lines
1.5 KiB
YAML
Raw Normal View History

2024-12-18 20:29:00 +00:00
# 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:
2024-12-21 20:32:57 +00:00
- SERVICE_FQDN_NODEBB_4567
2024-12-18 20:29:00 +00:00
volumes:
- 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
"
2024-12-18 20:29:00 +00:00
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:
2024-12-21 20:32:57 +00:00
POSTGRES_USER: ${SERVICE_USER_POSTGRES}
POSTGRES_PASSWORD: ${SERVICE_PASSWORD_POSTGRES}
2024-12-18 20:29:00 +00:00
POSTGRES_DB: nodebb
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U nodebb", "-d", "nodebb" ]
interval: 5s
retries: 10
2024-12-21 20:32:57 +00:00
timeout: 2s