2025-02-03 00:26:07 +10:30
|
|
|
# Notes server
|
2024-09-24 23:42:37 +09:30
|
|
|
|
2025-02-03 23:43:20 +10:30
|
|
|
## Set up mkdocs and build HTML
|
|
|
|
|
|
|
|
|
|
````bash
|
|
|
|
|
# Set up a Python virtualenv for mkdocs.
|
|
|
|
|
sudo apt install virtualenv
|
|
|
|
|
virtualenv .venv
|
|
|
|
|
. .venv/bin/activate
|
|
|
|
|
|
|
|
|
|
# Install mkdocs.
|
|
|
|
|
pip install mkdocs
|
|
|
|
|
|
|
|
|
|
# Build the HTML.
|
|
|
|
|
mkdocs build
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Build and run server
|
2025-02-03 00:26:07 +10:30
|
|
|
|
|
|
|
|
```bash
|
2025-02-03 00:29:54 +10:30
|
|
|
# Set access credentials.
|
|
|
|
|
./passwd.sh username password
|
|
|
|
|
|
2025-02-03 00:26:07 +10:30
|
|
|
# Build/rebuild the image.
|
|
|
|
|
docker build --no-cache -t notes-server .
|
|
|
|
|
|
2025-02-03 23:26:39 +10:30
|
|
|
# Run the image, listening on port 42069.
|
|
|
|
|
docker run --mount type=bind,src=./site,dst=/usr/share/nginx/html -p 42069:80 -t notes-server
|
2025-02-03 23:43:20 +10:30
|
|
|
````
|
2025-02-03 00:26:07 +10:30
|
|
|
|
|
|
|
|
## Auth credentials setup
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Overwrite the htpasswd file with new user credentials.
|
2025-02-03 23:26:39 +10:30
|
|
|
# (Rebuild the image to copy the new credentials.)
|
|
|
|
|
./passwd.sh username password
|
2025-02-03 00:26:07 +10:30
|
|
|
```
|