metatron-open-seo/SELF_HOSTING_DOCKER.md
Ben Senescu 3e489d0771
feat: remove Every App dependency (#8)
* remove Every App SDK and add auth modes for Cloudflare Access and local_noauth

* align local dev auth defaults and normalize Access team domain

* Apply suggestions from code review

* restore local drizzle D1 URL helper

* save

* fix auth error mapping and document self-hosting setup

* Tweak readme

* improve auth config error UI and remove manifest link

* fix team domain config validation and docs anchor
2026-03-10 14:36:16 -04:00

88 lines
1.7 KiB
Markdown

# Docker Self-Hosting
This guide runs OpenSEO as a local service.
In this mode, OpenSEO runs with `AUTH_MODE=local_noauth`, so request authentication is disabled and a local admin user (`admin@localhost`) is injected automatically.
## Prerequisites
- Docker Desktop (or Docker Engine + Docker Compose)
## Security and runtime caveats
This stack is local-first and uses dev runtimes to emulate Cloudflare Worker bindings.
- Do not expose these ports directly to the public internet.
- There is no built-in auth check in this mode.
- If you expose it beyond localhost, put it behind the same authentication layer you use for your other self-hosted services (or use the [Cloudflare deployment path](./README.md#cloudflare-deployment--access-setup)).
## 1) Configure env values
From the repository root:
```bash
cp .env.example .env
```
Set values as needed in `.env`.
Required:
- `DATAFORSEO_API_KEY`
Optional:
- `PORT` (defaults to `3001`)
- `AUTH_MODE=local_noauth` (Docker compose already sets this)
## 2) Start OpenSEO
```bash
docker compose up
```
URL:
- OpenSEO: `http://localhost:<PORT>` (defaults to `3001`)
Boot behavior:
- Uses dependencies installed during image build.
- Applies local D1 migrations on start.
- Starts local dev runtime (Vite).
## Troubleshooting
- OpenSEO env values seem stale: restart OpenSEO:
```bash
docker compose up -d open-seo
```
- If migrations fail on first run, rebuild and retry:
```bash
docker compose down
docker compose up
```
If you update dependencies or Docker build config, force a rebuild:
```bash
docker compose up --build
```
## Stop and cleanup
Stop stack:
```bash
docker compose down
```
Stop and remove Docker volumes:
```bash
docker compose down -v
```