Add docmost

This commit is contained in:
whitney 2026-04-17 17:00:35 -07:00
parent 72804b0039
commit b167f266e6
5 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# Generate with: openssl rand -hex 32
APP_SECRET=replace_with_long_random_secret
# PostgreSQL password (used by both the db container and Docmost's DATABASE_URL)
POSTGRES_PASSWORD=replace_with_strong_password

View File

@ -0,0 +1 @@
.env

View File

@ -0,0 +1,56 @@
# Docmost
[Docmost](https://docmost.com/) is an open-source collaborative documentation and wiki software.
Accessible at **https://documentation.whitney.rip**.
## Setup
1. Copy the example env file and fill in real values:
```bash
cp .env.example .env
```
2. Generate secrets:
```bash
# App secret (32+ characters)
openssl rand -hex 32
# Postgres password
openssl rand -hex 16
```
3. Start the stack:
```bash
docker compose up -d
```
## Health Check
```
https://documentation.whitney.rip/api/health
```
## Creating Users
Cannot be created manually, have to do manually via db insert.
1. Exec to container
```bash
docker exec -it docmost-db-1 psql -U docmost -d docmost
```
2. Obtain WORKSPACE_ID from the users table.
Generate random password
```bash
select workspace_id from users;
```
3. Exit psql and generate random passord.
```
docker exec docmost-docmost-1 node -e "console.log(require('bcrypt').hashSync('REPLACE_PASSWORD', 12))"
```
3. Insert
```bash
INSERT INTO users (name, email, password, role, workspace_id, email_verified_at) VALUES ('Jake', 'jake@runyan.dev', '$2b$10$BEiObFC7osNTuY9GcQvV6eCU6vHKQjwohrr/uPPBFzlO27jLvQCHy', 'admin', '019d9dbf-daf5-7652-90d6-33ee72c883a1', now());
```

View File

@ -0,0 +1,51 @@
networks:
traefik:
external: true
docmost:
driver: bridge
services:
docmost:
image: docmost/docmost:latest
depends_on:
- db
- redis
environment:
APP_URL: "https://documentation.whitney.rip"
APP_SECRET: "${APP_SECRET}"
DATABASE_URL: "postgresql://docmost:${POSTGRES_PASSWORD}@db:5432/docmost"
REDIS_URL: "redis://redis:6379"
restart: unless-stopped
volumes:
- /pwspool/software/docmost/storage:/app/data/storage
networks:
- traefik
- docmost
labels:
- "traefik.enable=true"
- "traefik.http.routers.docmost.rule=Host(`documentation.whitney.rip`)"
- "traefik.http.routers.docmost.entrypoints=websecure"
- "traefik.http.routers.docmost.tls.certresolver=letsencrypt"
- "traefik.http.services.docmost.loadbalancer.server.port=3000"
db:
image: postgres:18
environment:
POSTGRES_DB: docmost
POSTGRES_USER: docmost
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
restart: unless-stopped
volumes:
- /pwspool/software/docmost/postgresql:/var/lib/postgresql
networks:
- docmost
redis:
image: redis:8
command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"]
restart: unless-stopped
volumes:
- /pwspool/software/docmost/redis:/data
networks:
- docmost

View File

@ -10,6 +10,7 @@ declare -a CONTAINERS=(
"software-development/design/excalidraw" "software-development/design/excalidraw"
"software-development/project-management/planka" "software-development/project-management/planka"
"software-development/documentation/code-server" "software-development/documentation/code-server"
"software-development/documentation/docmost"
"software-development/infrastructure/gitea" "software-development/infrastructure/gitea"
"software-development/infrastructure/grafana" "software-development/infrastructure/grafana"
"software-development/infrastructure/traefik" "software-development/infrastructure/traefik"