Skip to content

armgit / boop

Public Imported from GitHub
0

A tiny, self-hosted notification inbox for developers. Something happened in one of your apps; Boop tells you on your phone.

HTML

Add Dokploy specific docker-compose file

Chris Gregoribb0e4c3eba94
diff --git a/.env.example b/.env.example
index 794fb4a..a836e5b 100644
--- a/.env.example
+++ b/.env.example
@@ -13,9 +13,14 @@ BOOP_ADMIN_PASSWORD=change-me-please
APNS_TEAM_ID=
APNS_KEY_ID=
APNS_BUNDLE_ID=
-APNS_PRIVATE_KEY_PATH=/run/secrets/apns.p8
-# Or, instead of a mounted file (e.g. on Dokploy), paste the key here:
+# Set exactly one of the two below. A non-empty APNS_PRIVATE_KEY_PATH always
+# wins over APNS_PRIVATE_KEY, so leave it blank if you are pasting the key.
+#
+# Mounted file (the local docker-compose.yml secrets volume):
+APNS_PRIVATE_KEY_PATH=
+# Or paste the key, PEM text or base64 (easiest on Dokploy and other
+# single-line env editors):
# base64 -i AuthKey_XXXXXX.p8 | tr -d '\n'
-# APNS_PRIVATE_KEY=
+APNS_PRIVATE_KEY=
# production or sandbox (use sandbox for Xcode debug builds)
APNS_ENVIRONMENT=production
diff --git a/Makefile b/Makefile
index 9aa80c6..f08f8a0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: dev web build test test-go test-web docker up down clean
+.PHONY: dev web build test test-go test-web docker up down container-up container-down clean
# Run the Go server locally (UI must be built first, or use `make dev` + vite).
run:
@@ -33,5 +33,21 @@ up:
down:
docker compose down
+# Apple `container` (macOS 26+) has no compose support, so the single boop
+# service is translated by hand. Note: no `restart: unless-stopped` equivalent.
+container-up:
+ container system start
+ mkdir -p data
+ container build -t ghcr.io/chrisgreg/boop:latest server
+ container run -d --name boop \
+ -p 8080:8080 \
+ -v "$(PWD)/data:/data" \
+ -e BOOP_DATABASE_PATH=/data/boop.db \
+ ghcr.io/chrisgreg/boop:latest
+
+container-down:
+ -container stop boop
+ -container rm boop
+
clean:
rm -rf bin server/internal/web/dist/assets server/internal/web/dist/index.html server/web/node_modules
diff --git a/README.md b/README.md
index cf5a25a..b25cc03 100644
--- a/README.md
+++ b/README.md
@@ -143,20 +143,23 @@ Credentials: project keys (`boop_proj_...`) can only create events; device crede
1. In the Apple Developer portal, create an App identifier for your Boop iOS build and enable Push Notifications.
2. Under Keys, create an APNs authentication key. Download the `.p8` (only possible once). Note the Key id.
3. Note your Team id (top right of the portal).
-4. Put the `.p8` at `./secrets/apns.p8`, uncomment the secrets volume in `docker-compose.yml`, and fill the `APNS_*` values in `.env`.
+4. Put the `.p8` at `./secrets/apns.p8`, uncomment the secrets volume in `docker-compose.yml`, set `APNS_PRIVATE_KEY_PATH=/run/secrets/apns.p8`, and fill the other `APNS_*` values in `.env`.
5. Restart: `docker compose up -d`. Settings should show APNs as configured.
6. Build the iOS app with the same bundle id, install it on your phone, open Devices → Pair iPhone, and scan the QR.
7. Settings → Send test notification.
## Deploying with Dokploy (or any compose host)
-1. New **Compose** application → your repo, compose path `docker-compose.yml`.
-2. Change the data volume to a named one so it survives redeploys: replace `"./data:/data"` with `boop-data:/data` and add a top-level `volumes: { boop-data: {} }` (or set a persistent mount in Dokploy's **Mounts** tab pointing at `/data`).
-3. **Environment** tab: `BOOP_BASE_URL`, `BOOP_ADMIN_USER`, `BOOP_ADMIN_PASSWORD`, `APNS_TEAM_ID`, `APNS_KEY_ID`, `APNS_BUNDLE_ID`, `APNS_ENVIRONMENT`.
-4. The `.p8` key, either:
- - `APNS_PRIVATE_KEY` = `base64 -i AuthKey_XXXXXX.p8 | tr -d '\n'` (one line, easiest), or
- - Dokploy **Mounts → File mount**: paste the `.p8` contents, mount path `/run/secrets/apns.p8`, and set `APNS_PRIVATE_KEY_PATH=/run/secrets/apns.p8`.
-5. Add a domain with HTTPS in Dokploy pointing at port `8080`; deploy. Settings in the web UI should show **APNs · Configured**.
+Use `docker-compose.dokploy.yml`, not `docker-compose.yml`. It swaps the `./data` bind mount for a named volume (the bind mount is created root-owned on the host, and the image runs as uid 1000, so SQLite cannot write `/data/boop.db`), joins the external `dokploy-network` so Traefik can route to it, and drops the published port so the server is reachable only through your HTTPS proxy.
+
+1. New **Compose** application → your repo, compose path `docker-compose.dokploy.yml`.
+2. **Environment** tab: `BOOP_BASE_URL`, `BOOP_ADMIN_USER`, `BOOP_ADMIN_PASSWORD`, `APNS_TEAM_ID`, `APNS_KEY_ID`, `APNS_BUNDLE_ID`, `APNS_ENVIRONMENT`. Dokploy writes these to a `.env` beside the compose file, which is what `env_file` picks up.
+3. The `.p8` key, either:
+ - `APNS_PRIVATE_KEY` = `base64 -i AuthKey_XXXXXX.p8 | tr -d '\n'` (one line, easiest). **Leave `APNS_PRIVATE_KEY_PATH` unset** — if it has a value it overrides the inline key, and the resulting missing-file error is the usual reason APNs looks unconfigured after a deploy. Copying `.env.example` wholesale is how it ends up set.
+ - Or Dokploy **Mounts → File mount**: paste the `.p8` contents, mount path `/run/secrets/apns.p8`, and set `APNS_PRIVATE_KEY_PATH=/run/secrets/apns.p8`.
+4. Add a domain with HTTPS in Dokploy pointing at port `8080`; deploy. Settings in the web UI should show **APNs · Configured**.
+
+Editing the compose file in Dokploy's UI only works for **Raw** compose apps; when the source is Git, commit changes and redeploy.
## Pairing
diff --git a/docker-compose.dokploy.yml b/docker-compose.dokploy.yml
new file mode 100644
index 0000000..dd964ef
--- /dev/null
+++ b/docker-compose.dokploy.yml
@@ -0,0 +1,38 @@
+# Compose file for Dokploy (or any host that puts Traefik in front of you).
+#
+# Differences from docker-compose.yml, which stays the file to use locally:
+# - named volume instead of "./data", because the bind mount would be created
+# root-owned on the host and the image runs as uid 1000, so SQLite could not
+# write /data/boop.db.
+# - joins the external dokploy-network so Traefik can route your domain here.
+# - no published port: Traefik reaches 8080 over that network. Publishing it
+# would also expose the server on the host's public IP, past your HTTPS
+# proxy and past the admin login.
+#
+# Set APNS_* in Dokploy's Environment tab, not here. Use APNS_PRIVATE_KEY with
+# the base64 of your .p8 and leave APNS_PRIVATE_KEY_PATH unset -- when the path
+# is set it wins over the inline key, and the file does not exist here.
+services:
+ boop:
+ build:
+ context: ./server
+ image: ghcr.io/chrisgreg/boop:latest
+ restart: unless-stopped
+ expose:
+ - "8080"
+ volumes:
+ - "boop-data:/data"
+ env_file:
+ - path: .env
+ required: false
+ environment:
+ BOOP_DATABASE_PATH: /data/boop.db
+ networks:
+ - dokploy-network
+
+volumes:
+ boop-data:
+
+networks:
+ dokploy-network:
+ external: true