Replace S3 storage with Docker-mounted filesystem
- Add Docker and Compose deployment with persistent HTML and Postgres volumes - Remove AWS storage configuration and dependency - Document local Docker setup and filesystem storage
This commit is contained in:
@@ -44,14 +44,11 @@ Required service variables:
|
||||
|
||||
- `DATABASE_URL`
|
||||
- `POSTPLAN_BOOTSTRAP_API_KEY`
|
||||
- `AWS_ENDPOINT_URL`
|
||||
- `AWS_ACCESS_KEY_ID`
|
||||
- `AWS_SECRET_ACCESS_KEY`
|
||||
- `AWS_S3_BUCKET_NAME`
|
||||
- `AWS_DEFAULT_REGION`
|
||||
|
||||
Optional service variables:
|
||||
|
||||
- `POSTPLAN_HTML_DIR` - directory for uploaded HTML files (default `./data/html`; Docker Compose mounts this at `/data/html`).
|
||||
|
||||
- `POSTPLAN_PUBLIC_BASE_URL` - set to a normal base URL for `/d/<draft-id>` URLs, or a wildcard URL such as `https://*.postplan.dev` for draft subdomains.
|
||||
- `POSTPLAN_SESSION_SECRET` - together with `POSTPLAN_PUBLIC_BASE_URL`, enables web sign-in (the dashboard and `/cli/auth`). If either is absent, those routes return 503 and uploads/serving are unaffected.
|
||||
- `SHOO_BASE_URL` - identity broker for web sign-in (default `https://shoo.dev`).
|
||||
@@ -88,30 +85,21 @@ The upload API returns both `publicUrl` and `rawUrl`, and the CLI prints the raw
|
||||
- `https://postplan.dev/d/<draft-id>/raw`
|
||||
- `https://postplan.dev/d/<draft-id>/v/<n>/raw`
|
||||
|
||||
## Railway Provisioning
|
||||
## Docker
|
||||
|
||||
After `railway login` succeeds, provision and deploy the first-pass stack:
|
||||
Uploaded HTML is stored on the filesystem. Compose bind-mounts `./data/html` to `/data/html` in the app container so drafts persist across rebuilds. Override the host path with `POSTPLAN_HTML_VOLUME`.
|
||||
|
||||
```sh
|
||||
chmod +x scripts/provision-railway.sh
|
||||
scripts/provision-railway.sh
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
The script creates a Railway project, app service, Postgres service, object storage bucket, service variables, Railway domain, and first deployment. It stores the generated bootstrap API key under `~/.postplan/deployments/`.
|
||||
|
||||
Verify the deployed service:
|
||||
|
||||
```sh
|
||||
POSTPLAN_URL=https://your-railway-domain \
|
||||
POSTPLAN_API_KEY=your-bootstrap-or-cli-key \
|
||||
scripts/verify-deployment.sh
|
||||
```
|
||||
The API listens on `http://localhost:3000`. Point the CLI at it with `--api-url http://localhost:3000`. The default bootstrap key is `dev-bootstrap-key`; set `POSTPLAN_BOOTSTRAP_API_KEY` to override it.
|
||||
|
||||
Create a named key from the bootstrap key:
|
||||
|
||||
```sh
|
||||
curl -X POST "$POSTPLAN_URL/api/api-keys" \
|
||||
-H "Authorization: Bearer $POSTPLAN_BOOTSTRAP_API_KEY" \
|
||||
curl -X POST "http://localhost:3000/api/api-keys" \
|
||||
-H "Authorization: Bearer ${POSTPLAN_BOOTSTRAP_API_KEY:-dev-bootstrap-key}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"local-cli"}'
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user