mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-08-13 03:50:19 +02:00
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:
@@ -0,0 +1,6 @@
|
||||
# Merge these into the repository root .env (see /.env for all other variables).
|
||||
#
|
||||
# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD must match examples/external-minio/infra.env.example
|
||||
# when starting the external MinIO infra stack.
|
||||
MINIO_ROOT_USER=minioadmin
|
||||
MINIO_ROOT_PASSWORD=minioadmin
|
||||
@@ -0,0 +1,43 @@
|
||||
# External MinIO
|
||||
|
||||
MinIO 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 embedded `notesnook-s3` / `setup-s3` and points at external MinIO. Embedded MongoDB is unchanged.
|
||||
|
||||
## Setup
|
||||
|
||||
From the **repository root**:
|
||||
|
||||
```bash
|
||||
# Ensure MINIO_* in root .env match infra.env.example
|
||||
# Merge notesnook delta if needed (see .env.example)
|
||||
|
||||
# 1. MinIO + bucket setup
|
||||
docker compose -f examples/external-minio/infra.compose.yml \
|
||||
--env-file examples/external-minio/infra.env.example up -d
|
||||
|
||||
# Wait for notesnook-minio-setup to complete
|
||||
docker compose -f examples/external-minio/infra.compose.yml ps -a
|
||||
|
||||
# 2. Notesnook
|
||||
docker compose -f docker-compose.yml -f examples/external-minio/notesnook.override.yml up -d
|
||||
```
|
||||
|
||||
## Environment
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| [`infra.env.example`](infra.env.example) | `MINIO_ROOT_USER` / `MINIO_ROOT_PASSWORD` for infra stack |
|
||||
| [`.env.example`](.env.example) | Notesnook delta (credentials must match infra) |
|
||||
|
||||
Merge `MINIO_*` into root [`.env`](../../.env) so the sync server uses the same credentials.
|
||||
|
||||
## Stop
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose.yml -f examples/external-minio/notesnook.override.yml down
|
||||
docker compose -f examples/external-minio/infra.compose.yml down
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Bucket `attachments` is created by `notesnook-minio-setup` on first infra start.
|
||||
- `S3_INTERNAL_SERVICE_URL` is overridden to `http://notesnook-minio:9000`.
|
||||
@@ -0,0 +1,47 @@
|
||||
name: notesnook-external-minio-infra
|
||||
|
||||
services:
|
||||
notesnook-minio:
|
||||
image: minio/minio:RELEASE.2024-07-29T22-14-52Z
|
||||
hostname: notesnook-minio
|
||||
ports:
|
||||
- 9000:9000
|
||||
networks:
|
||||
- notesnook-shared
|
||||
volumes:
|
||||
- s3data:/data/s3
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
|
||||
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin}
|
||||
MINIO_BROWSER: "on"
|
||||
command: server /data/s3 --console-address :9090
|
||||
healthcheck:
|
||||
test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
|
||||
interval: 40s
|
||||
timeout: 30s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
|
||||
notesnook-minio-setup:
|
||||
image: minio/mc:RELEASE.2024-07-26T13-08-44Z
|
||||
depends_on:
|
||||
notesnook-minio:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- notesnook-shared
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
|
||||
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- |
|
||||
mc alias set minio http://notesnook-minio:9000 ${MINIO_ROOT_USER:-minioadmin} ${MINIO_ROOT_PASSWORD:-minioadmin}
|
||||
mc mb minio/attachments -p
|
||||
|
||||
networks:
|
||||
notesnook-shared:
|
||||
name: notesnook-shared
|
||||
|
||||
volumes:
|
||||
s3data:
|
||||
@@ -0,0 +1,2 @@
|
||||
MINIO_ROOT_USER=minioadmin
|
||||
MINIO_ROOT_PASSWORD=minioadmin
|
||||
@@ -0,0 +1,20 @@
|
||||
services:
|
||||
notesnook-s3:
|
||||
profiles: [embedded-disabled]
|
||||
|
||||
setup-s3:
|
||||
profiles: [embedded-disabled]
|
||||
|
||||
notesnook-server:
|
||||
networks:
|
||||
- notesnook
|
||||
- notesnook-shared
|
||||
depends_on: !override
|
||||
identity-server:
|
||||
condition: service_started
|
||||
environment:
|
||||
S3_INTERNAL_SERVICE_URL: "http://notesnook-minio:9000"
|
||||
|
||||
networks:
|
||||
notesnook-shared:
|
||||
external: true
|
||||
Reference in New Issue
Block a user