first commit

This commit is contained in:
2026-05-04 02:45:30 +02:00
parent c4a44520af
commit 898d7d3ff5
4 changed files with 65 additions and 9 deletions

View File

@ -6,3 +6,5 @@ DOMAIN=silverbullet.example.com
#EXTRA_DOMAINS=', `www.silverbullet.example.com`'
LETS_ENCRYPT_ENV=production
SECRET_SB_USER_VERSION=v1

View File

@ -1,2 +1,4 @@
# Set any config versions here
# Docs: https://docs.coopcloud.tech/maintainers/handbook/#manage-configs
export ENTRYPOINT_VERSION=v1

View File

@ -1,15 +1,25 @@
---
services:
app:
image: nginx:1.27.5
image: ghcr.io/silverbulletmd/silverbullet:2.6.1
networks:
- proxy
configs:
- source: entrypoint
target: /custom-entrypoint.sh
mode: 555
entrypoint: /custom-entrypoint.sh
environment:
- SB_USER_FILE=admin:password
volumes:
- sb_data:/space
config
deploy:
restart_policy:
condition: on-failure
condition: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
@ -27,13 +37,27 @@ services:
## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore
# - "backupbot.backup=true"
# - "backupbot.backup.path=/some/path"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
#healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost"]
# interval: 30s
# timeout: 10s
# retries: 10
# start_period: 1m
networks:
proxy:
external: true
volumes:
sb_data:
secrets:
sb_user:
name: ${STACK_NAME}_sb_user_${SECRET_SB_USER_VERSION}
external: true
configs:
entrypoint:
file: entrypoint.sh.tmpl
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
template_driver: golang

28
entrypoint.sh.tmpl Normal file
View File

@ -0,0 +1,28 @@
#!/bin/bash
set -eu
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "SB_USER"
/sbin/tini -- /docker-entrypoint.sh