first commit
This commit is contained in:
@ -6,3 +6,5 @@ DOMAIN=silverbullet.example.com
|
||||
#EXTRA_DOMAINS=', `www.silverbullet.example.com`'
|
||||
|
||||
LETS_ENCRYPT_ENV=production
|
||||
|
||||
SECRET_SB_USER_VERSION=v1
|
||||
|
||||
2
abra.sh
2
abra.sh
@ -1,2 +1,4 @@
|
||||
# Set any config versions here
|
||||
# Docs: https://docs.coopcloud.tech/maintainers/handbook/#manage-configs
|
||||
|
||||
export ENTRYPOINT_VERSION=v1
|
||||
|
||||
42
compose.yml
42
compose.yml
@ -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
28
entrypoint.sh.tmpl
Normal 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
|
||||
Reference in New Issue
Block a user