Added outline stack

This commit is contained in:
Rishi Ghan
2025-12-30 00:26:32 -05:00
parent aec2f32707
commit 0de12f8552
3 changed files with 50 additions and 81 deletions

View File

@@ -1,68 +1,29 @@
# Outline Stack # Outline Wiki
Outline Wiki with Postgres and Redis. Knowledge base and wiki.
## Services ## Deployment
| Service | Port | Description | Deploy via Portainer git stack or:
|---------|------|-------------|
| outline | 3000:3000 | Wiki application |
| outline-postgres | - | PostgreSQL database |
| outline-redis | - | Redis cache |
## Configuration Files
Copy `redis.conf` to `/mnt/user/appdata/outline/` before deploying.
## Dependencies
- S3 bucket for uploads: `outline-wiki-data-bucket`
- Slack app for authentication: https://api.slack.com/apps/A041B5BSXD2
## NGINX Proxy Manager
Create HTTPS proxy for `wiki.rishighan.com` pointing to `192.168.1.75:3000`
## Migration from VM
1. Create directories:
```bash ```bash
mkdir -p /mnt/user/appdata/outline/{postgres-data,redis} cd /mnt/user/data/flook-stacks/stacks/outline
cp redis.conf /mnt/user/appdata/outline/ docker compose up -d
``` ```
2. Export Postgres from VM: ## Restore Database
After first deploy, restore the database:
```bash ```bash
ssh rishi@192.168.1.112 docker exec -i outline-postgres psql -U rishi outline < /mnt/user/appdata/outline/outline-backup.sql
docker exec outline-postgres-1 pg_dump -U rishi outline > ~/outline_backup.sql
``` ```
3. Copy backup to Flook: ## Volumes
```bash
scp rishi@192.168.1.112:~/outline_backup.sql /mnt/user/appdata/outline/
```
4. Deploy stack via Portainer (creates empty DB) - `/mnt/user/appdata/outline/db-data` - PostgreSQL data
- `/mnt/user/appdata/outline/redis-data` - Redis data
5. Stop outline temporarily: ## NPM Proxy
```bash
docker stop outline
```
6. Import data: - `wiki.rishighan.com``192.168.1.75:3000`
```bash
docker exec -i outline-postgres psql -U rishi outline < /mnt/user/appdata/outline/outline_backup.sql
```
7. Start outline:
```bash
docker start outline
```
8. Update NPM proxy to point to 192.168.1.75:3000
9. Stop VM services after verification:
```bash
ssh rishi@192.168.1.112
cd ~/outline && docker compose down
```

View File

@@ -1,31 +1,43 @@
networks:
outline-net:
name: outline-net
driver: bridge
services: services:
outline: outline:
image: outlinewiki/outline:latest image: outlinewiki/outline:latest
container_name: outline container_name: outline
restart: unless-stopped restart: unless-stopped
command: sh -c "yarn db:migrate --env=production-ssl-disabled && yarn start --env=production-ssl-disabled" command: sh -c "yarn db:migrate --env=production-ssl-disabled && yarn start --env=production-ssl-disabled"
env_file: ./stack.env
ports: ports:
- 3000:3000 - "3000:3000"
env_file:
- stack.env
depends_on: depends_on:
- outline-redis - postgres
- outline-postgres - redis
networks:
- outline-net
outline-redis: postgres:
image: redis:latest
container_name: outline-redis
restart: unless-stopped
volumes:
- /mnt/user/appdata/outline/redis.conf:/redis.conf
- /mnt/user/appdata/outline/redis:/data
command: ["redis-server", "/redis.conf"]
outline-postgres:
image: postgres:15 image: postgres:15
container_name: outline-postgres container_name: outline-postgres
restart: unless-stopped restart: unless-stopped
env_file: environment:
- stack.env - POSTGRES_USER=rishi
- POSTGRES_PASSWORD=dexter
- POSTGRES_DB=outline
volumes: volumes:
- /mnt/user/appdata/outline/postgres-data:/var/lib/postgresql/data - /mnt/user/appdata/outline/db-data:/var/lib/postgresql/data
networks:
- outline-net
redis:
image: redis
container_name: outline-redis
restart: unless-stopped
volumes:
- /mnt/user/appdata/outline/redis-data:/data
- /mnt/user/appdata/outline/redis.conf:/redis.conf
command: ["redis-server", "/redis.conf"]
networks:
- outline-net

View File

@@ -1,13 +1,12 @@
# REQUIRED
SECRET_KEY=ce86b161b3e7e8ce75136060afd462673363b1b0d027aff8a2bfc097b20bb39a SECRET_KEY=ce86b161b3e7e8ce75136060afd462673363b1b0d027aff8a2bfc097b20bb39a
UTILS_SECRET=a9e89560aad956988f53949ab354dbff63bd5c75e08e560b2cbfcee71d2fae30 UTILS_SECRET=a9e89560aad956988f53949ab354dbff63bd5c75e08e560b2cbfcee71d2fae30
POSTGRES_USER=rishi POSTGRES_USER=rishi
POSTGRES_PASSWORD=dexter POSTGRES_PASSWORD=dexter
POSTGRES_DB=outline POSTGRES_DB=outline
DATABASE_URL=postgres://rishi:dexter@outline-postgres:5432/outline DATABASE_URL=postgres://rishi:dexter@postgres:5432/outline
DATABASE_URL_TEST=postgres://rishi:dexter@outline-postgres:5432/outline-test DATABASE_URL_TEST=postgres://rishi:dexter@postgres:5432/outline-test
PGSSLMODE=disable PGSSLMODE=disable
REDIS_URL=redis://outline-redis:6379 REDIS_URL=redis://redis:6379
URL=https://wiki.rishighan.com URL=https://wiki.rishighan.com
PORT=3000 PORT=3000
AWS_ACCESS_KEY_ID=AKIAQP5UUFQPKWAILLJK AWS_ACCESS_KEY_ID=AKIAQP5UUFQPKWAILLJK
@@ -17,12 +16,9 @@ AWS_S3_UPLOAD_BUCKET_URL=https://outline-wiki-data-bucket.s3.us-east-1.amazonaws
AWS_S3_UPLOAD_BUCKET_NAME=outline-wiki-data-bucket AWS_S3_UPLOAD_BUCKET_NAME=outline-wiki-data-bucket
AWS_S3_UPLOAD_MAX_SIZE=26214400 AWS_S3_UPLOAD_MAX_SIZE=26214400
AWS_S3_FORCE_PATH_STYLE=false AWS_S3_FORCE_PATH_STYLE=false
# AUTHENTICATION
SLACK_KEY=11934097441.4045181915444 SLACK_KEY=11934097441.4045181915444
SLACK_SECRET=740d1d0b375d7609cd1fa18de2b1e8d4 SLACK_SECRET=740d1d0b375d7609cd1fa18de2b1e8d4
GOOGLE_ANALYTICS_ID=UA-XXXXXXX-1
# OPTIONAL
SLACK_VERIFICATION_TOKEN=StwRrYvcGHCDME4a5x2jU9zq SLACK_VERIFICATION_TOKEN=StwRrYvcGHCDME4a5x2jU9zq
SLACK_APP_ID=A041B5BSXD2 SLACK_APP_ID=A041B5BSXD2
SLACK_MESSAGE_ACTIONS=true SLACK_MESSAGE_ACTIONS=true