Skip to content

Instantly share code, notes, and snippets.

@wastemobile
Last active November 21, 2022 08:03
Show Gist options
  • Save wastemobile/21ea74e78c6601d6e907b9cc3308277b to your computer and use it in GitHub Desktop.
Save wastemobile/21ea74e78c6601d6e907b9cc3308277b to your computer and use it in GitHub Desktop.
microblog.pub

microblog.pub

一個極簡、python 寫的 microblog,支援 ActivityPub 與大部分 IndieWeb 功能。

使用 docker compose 安裝,須將靜態目錄 volume 拉出來讓 Caddy 讀到。

遇到 /app/static/twemoji 空目錄的問題(編輯界面引用的圖示出不來), 查原始碼應該是 task.py 中一段下載 twemoji 倉儲檔案的部分沒執行,卻又完全找不到解決點, 最後⋯⋯只好暴力的在 mac 下載、scp 送上主機,暫時能用。

version: '3'
services:
caddy:
image: caddy:alpine
restart: always
container_name: caddy2
ports:
- "80:80"
- "443:443"
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- $PWD/Caddyfile:/etc/caddy/Caddyfile
- $PWD/caddy_data:/data
- $PWD/caddy_config:/config
- $PWD/app/static:/usr/share/caddy/microblog-static
networks:
- coilnet
microblog:
depends_on:
- caddy
image: microblogpub/microblogpub:latest
container_name: microblog
user: 1000:1000
restart: always
networks:
- coilnet
volumes:
- $PWD/data:/app/data
- $PWD/app/static:/app/app/static
watchtower:
image: containrrr/watchtower
container_name: watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
coilnet:
ipam:
config:
- subnet: 172.21.0.0/24
{
email [email protected]
}
yourdomain.com {
log
handle_path /static* {
root * /usr/share/caddy/microblog-static
encode zstd gzip
file_server
}
route {
reverse_proxy microblog:8000
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment