docker: fix compose self-hosting and add external Mongo/MinIO/Garage examples (#106)

* docker: update .env and docker-compose.yml for SMTP and new services

* docker: add external MinIO, MongoDB, and GarageHQ examples with setup instructions

* docs: update README with dotenv docker setup instructions and configuration redirect for external services

* docker: update service dependency condition for setup-themes in docker-compose.yml

* chore: update example URLs in .env for public services
This commit is contained in:
Ibaraki Douji
2026-07-29 09:07:52 +05:00
committed by GitHub
parent 7ce7f02646
commit 3c7327d3c7
20 changed files with 663 additions and 18 deletions
+4
View File
@@ -0,0 +1,4 @@
# Merge these into the repository root .env (see /.env for all other variables).
MONGODB_CONNECTION_STRING_IDENTITY=mongodb://notesnook-mongodb:27017/identity?replSet=rs0
MONGODB_CONNECTION_STRING=mongodb://notesnook-mongodb:27017/?replSet=rs0
+36
View File
@@ -0,0 +1,36 @@
# External MongoDB
MongoDB runs in a separate compose project. The Notesnook stack uses the root [`docker-compose.yml`](../../docker-compose.yml) with [`notesnook.override.yml`](notesnook.override.yml), which disables the embedded `notesnook-db` service and points at external Mongo. Embedded MinIO is unchanged.
## Setup
From the **repository root**:
```bash
# Merge into root .env
cat examples/external-mongodb/.env.example >> .env
# set NOTESNOOK_API_SECRET and other required root .env values
# 1. MongoDB
docker compose -f examples/external-mongodb/infra.compose.yml up -d
# 2. Notesnook
docker compose -f docker-compose.yml -f examples/external-mongodb/notesnook.override.yml up -d
```
## Environment (delta)
See [`.env.example`](.env.example) — only `MONGODB_CONNECTION_STRING*` overrides are needed beyond the root `.env`.
## Stop
```bash
docker compose -f docker-compose.yml -f examples/external-mongodb/notesnook.override.yml down
docker compose -f examples/external-mongodb/infra.compose.yml down
```
## Notes
- Replica set `rs0` is required; the infra healthcheck initializes it.
- Host port `27017` is exposed for debugging.
- If infra stops, `identity-server` and `notesnook-server` fail until MongoDB is back.
@@ -0,0 +1,26 @@
name: notesnook-external-mongodb-infra
services:
notesnook-mongodb:
image: mongo:7.0.12
hostname: notesnook-mongodb
ports:
- 27017:27017
volumes:
- dbdata:/data/db
networks:
- notesnook-shared
command: --replSet rs0 --bind_ip_all
healthcheck:
test: echo 'try { rs.status() } catch (err) { rs.initiate() }; db.runCommand("ping").ok' | mongosh mongodb://localhost:27017 --quiet
interval: 40s
timeout: 30s
retries: 3
start_period: 60s
networks:
notesnook-shared:
name: notesnook-shared
volumes:
dbdata:
@@ -0,0 +1,31 @@
services:
notesnook-db:
profiles: [embedded-disabled]
identity-server:
depends_on: !override
validate:
condition: service_completed_successfully
networks:
- notesnook
- notesnook-shared
environment:
MONGODB_CONNECTION_STRING: ${MONGODB_CONNECTION_STRING_IDENTITY}
notesnook-server:
networks:
- notesnook
- notesnook-shared
depends_on: !override
notesnook-s3:
condition: service_started
setup-s3:
condition: service_started
identity-server:
condition: service_started
environment:
MONGODB_CONNECTION_STRING: ${MONGODB_CONNECTION_STRING}
networks:
notesnook-shared:
external: true