常用 Docker 容器
Siyuan(在线笔记)
docker run -d \
-v /root/siyuan/workspace:/siyuan/workspace \
-p 6806:6806 \
-u $(id -u):$(id -g) \
--name siyuan \
--accessAuthCode=xxx \ #鉴权码,一定要记得改
b3log/siyuan:latest \ #指定版本,或者使用 latest 最新版
--workspace=/siyuan/workspace/
speedtest-x
docker run -d -p 9001:80 -it badapple9/speedtest-x
tinyfilemanager
wget https://raw.githubusercontent.com/prasathmani/tinyfilemanager/master/tinyfilemanager.php -O /root/index.php
# 使用下载的index.php做配置文件
docker run -d \
-v /absolute/path:/var/www/html/data \
-v /root/index.php:/var/www/html/index.php \
-p 3380:80 \
--restart=always \
--name tinyfilemanager \
tinyfilemanager/tinyfilemanager:master
ubuntu-novnc(Web桌面)
docker run --rm -d -p 6088:6088 -v $PWD:/workspace:rw -e USER=admin -e PASSWORD=123456 -e RESOLUTION=1080x600 --name ubuntu-novnc fredblgr/ubuntu-novnc:20.04
docker run -d -p 6080:80 -v $PWD:/workspace:rw -e USER=admin -e PASSWORD=123456 -e RESOLUTION=1120x700 --name ubuntu-novnc fredblgr/ubuntu-novnc:20.04
vaultwarden/Bitwarden(密码库)
github.com/dani-garcia/vaultwarden
#首次部署
docker pull vaultwarden/server:latest
docker run -d --name vaultwarden -v /root/docker_data/vw-data/:/data/ -p 8880:80 vaultwarden/server:latest
#禁止注册
docker run -d --name bitwarden \
-e SIGNUPS_ALLOWED=false \
-v /root/docker_data/vw-data/:/data/ \
-p 8880:80 \
vaultwarden/server:latest
uptime-kuma(主机监控)
https://github.com/louislam/uptime-kuma
docker run -d --restart=always \
--name uptime-kuma \
-p 3001:3001 \
-v /root/docker_data/uptime-kuma:/app/data \
louislam/uptime-kuma:1
Goproxy
docker run -d --name="gh-proxy-py" \
-p 0.0.0.0:34860:80 \
--restart=always \
hunsh/gh-proxy-py:latest
Filecodebox (文件存取柜)
docker run -d \
--restart=always \
-p 12345:12345 \
-v /root/docker_data/FileCodeBox/:/app/data \
--name filecodebox lanol/filecodebox:latest
Waline(评论系统)
需下载 waline.sqlite 至/www/wwwroot/waline/data
下
# docker-compose.yml
version: '3'
services:
waline:
container_name: waline
image: lizheming/waline:latest
restart: always
ports:
- 127.0.0.1:8360:8360
volumes:
- /root/docker_data/waline/data:/app/data
environment:
TZ: 'Asia/Shanghai'
SQLITE_PATH: '/app/data'
JWT_TOKEN: 'Your token'
SITE_NAME: '网站名
SITE_URL: 'https://www.example.com'
SECURE_DOMAINS: 'www.example.com'
AUTHOR_EMAIL: 'email'
SC_KEY: '通知KEY
lang: 'zh-CN'
Flare 书签
building-a-personal-bookmark-navigation-app-from-scratch-flare.html
https://github.com/soulteary/docker-flare
version: '3.6'
services:
flare:
image: soulteary/flare
restart: always
# 默认无需添加任何参数,如有特殊需求
# 可阅读文档 https://github.com/soulteary/docker-flare/blob/main/docs/advanced-startup.md
command: flare
# 启用账号登录模式
command: flare --nologin=0
environment:
# 如需开启用户登录模式,需要先设置 `nologin` 启动参数为 `0`
# 如开启 `nologin`,未设置 FLARE_USER,则默认用户为 `flare`
- FLARE_USER=flare
# 指定你自己的账号密码,如未设置 `FLARE_USER`,则会默认生成密码并展示在应用启动日志中
- FLARE_PASS=123456
# 是否开启“使用向导”,访问 `/guide`
# - FLARE_GUIDE=1
ports:
- 5005:5005
volumes:
- /root/docker_data/flare/app:/app
或者
docker run -d \
--restart=always \
-p 5005:5005 \
-v /root/docker_data/docker/flare/app:/app \
-v FLARE_USER=flare \
-v FLARE_PASS=123456 \
--name flare soulteary/flare:latest
反代配置
location / {
proxy_pass http://127.0.0.1:3020/; # 注意改成你实际使用的端口
rewrite ^/(.*)$ /$1 break;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade-Insecure-Requests 1;
proxy_set_header X-Forwarded-Proto https;
}
memos(类似 Flome)
docker run -d --name memos -p 5230:5230 -v /root/docker_data/memos/.memos/:/var/opt/memos neosmemo/memos:latest
或者
version: "3"
services:
memos:
image: neosmemo/memos:latest
container_name: memeos
hostname: memeos
ports:
- "5230:5230"
volumes:
- /root/docker_data/memos/.memos/:/var/opt/memos
restart: always
Nginx Proxy Manager(Docker Proxy)
sudo -i
mkdir -p /root/docker_data/npm
cd /root/docker_data/npm
vim docker-compose.yml
docker-compose up -d
docker-compose.yml
version: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80' # 冒号左边可以改成自己服务器未被占用的端口
- '81:81' # 冒号左边可以改成自己服务器未被占用的端口
- '443:443' # 冒号左边可以改成自己服务器未被占用的端口
volumes:
- /root/docker_data/npm/data:/data # 冒号左边可以改路径,现在是表示把数据存放在在当前文件夹下的 data 文件夹中
- /root/docker_data/npm/etc/letsencrypt:/etc/letsencrypt # 冒号左边可以改路径
或
docker run -d --name npm \
-p 80:80 \
-p 443:443 \
-p 81:81 \
-v /root/docker_data/npm/data:/data \
-v /root/docker_data/npm/etc/letsencrypt:/etc/letsencrypt \
jc21/nginx-proxy-manager:latest
默认登陆名和密码:
Email: admin@example.com
Password: changeme
SearXNG (搜索引擎)
version: '3.7'
services:
redis:
container_name: redis
image: "redis:alpine"
command: redis-server --save "" --appendonly "no"
networks:
- searxng
tmpfs:
- /var/lib/redis
cap_drop:
- ALL
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
searxng:
container_name: searxng
image: searxng/searxng:latest
networks:
- searxng
ports:
- "8180:8080" # 这个冒号左边的端口可以更改,右边的不要改
volumes:
- /root/docker_data/searxng:/etc/searxng
environment:
- SEARXNG_BASE_URL=https://search.example.com/
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
- DAC_OVERRIDE
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "1"
networks:
searxng:
ipam:
driver: default
Minimalist-web-notepad(在线剪切板/笔记)
pereorga/minimalist-web-notepad
docker run -d -p 8890:80 -v /mnt/notepad:/var/www/html/_tmp jdreinhardt/minimalist-web-notepad:latest
反代
location / {
proxy_pass http://127.0.0.1:8006/;
rewrite ^/(.*)$ /$1 break;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade-Insecure-Requests 1;
proxy_set_header X-Forwarded-Proto https;
}
aria2-pro
最基本的启动命令如下,你只需要完整替换
<TOKEN>
字段(RPC密钥)即可启动。docker run -d \ --name aria2-pro \ --restart unless-stopped \ --log-opt max-size=1m \ --network host \ -e PUID=$UID \ -e PGID=$GID \ -e RPC_SECRET=<TOKEN> \ -e RPC_PORT=6800 \ -e LISTEN_PORT=6888 \ -v $PWD/aria2-config:/config \ -v $PWD/aria2-downloads:/downloads \ p3terx/aria2-pro
Duplicati (备份)
version: "2.1"
services:
duplicati:
image: lscr.io/linuxserver/duplicati
container_name: duplicati
environment:
- PUID=0
- PGID=0
- TZ=Asia/Shanghai
volumes:
- /root/data/docker_data/duplicati/config:/config
- /root/data/docker_data/duplicati/backups:/backups
- /root/data:/source
ports:
- 8080:8200
restart: unless-stopped
Microbin(剪切板)
version: '3.5'
services:
microbin:
image: danielszabo99/microbin:latest
container_name: microbin
restart: unless-stopped
environment:
- TZ=Asia/Shanghai
- MICROBIN_HIGHLIGHTSYNTAX=true
- MICROBIN_HASH_IDS=true
- MICROBIN_EDITABLE=true
- MICROBIN_PRIVATE=false
- MICROBIN_HIDE_FOOTER=true
- MICROBIN_HELP=true
# - MICROBIN_FOOTER_TEXT=xxx
- MICROBIN_HIDE_HEADER=true
- MICROBIN_HIDE_LOGO=false
- MICROBIN_NO_ETERNAL_PASTA=true
- MICROBIN_NO_FILE_UPLOAD=false
- MICROBIN_NO_LISTING=true
- MICROBIN_THREADS=2
- MICROBIN_TITLE=free-bin
- MICROBIN_PUBLIC_PATH=https://example.com/ # 记得改成自己的网址
- MICROBIN_QR=true
ports:
- 8089:8080 # 冒号左边可以改成自己需要的端口号
volumes:
- /roor/data/docker_data/microbin-data:/app/pasta_data # 冒号左边可以改自己想要的挂载路径
hasty-paste
https://github.com/enchant97/hasty-paste
https://enchantedcode.co.uk/hasty-paste/install.html#configuration
version: "3"
services:
paste-bin:
container_name: paste-bin
image: ghcr.io/enchant97/hasty-paste:1
restart: unless-stopped
volumes:
- /root/data/hastypaste/data:/app/data
ports:
- 8000:8000
environment:
- "NEW_AT_INDEX=true"
- "TIME_ZONE=Asia/Shanghai"
- "UI_DEFAULT__EXPIRE_TIME__ENABLE=true"
- "UI_DEFAULT__EXPIRE_TIME__HOURS=24"
- "BRANDING__HIDE_VERSION=true"
volumes:
data:
给相应文件夹授权
chmod -R 777 /root/data/hastypaste/data
Nginx反代配置
location / {
proxy_pass http://127.0.0.1:8000/; # 注意改成你实际使用的端口
rewrite ^/(.*)$ /$1 break;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade-Insecure-Requests 1;
proxy_set_header X-Forwarded-Proto https;
}
minimalist-web-notepad
pereorga/minimalist-web-notepad
docker run -d -p 8890:80 -v /root/docker/notepad:/var/www/html/_tmp jdreinhardt/minimalist-web-notepad:latest
反代
location / {
proxy_pass http://127.0.0.1:8890/;
rewrite ^/(.*)$ /$1 break;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade-Insecure-Requests 1;
proxy_set_header X-Forwarded-Proto https;
}
ChatGPT
选用服务器先测试一下是否可以访问ChatGPT:
bash <(curl -Ls https://cpp.li/openai)
bash <(curl -Ls https://ourl.co/oaic)
1. Chatgpt-web
docker run -d \
-p 3002:3002 \
-e OPENAI_API_KEY=sk-xxx \
-e AUTH_SECRET_KEY=your-password \
--name chatgpt-web-2 \
chenzhaoyu94/chatgpt-web:latest
2. Chatgpt-next-web
docker run -d \
-p 3000:3000 \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=your-password \
--name chatgpt-next-web \
yidadaa/chatgpt-next-web:latest
3. gpt-academic
git clone https://github.com/binary-husky/chatgpt_academic.git
cd chatgpt_academic
docker build -t gpt-academic .
docker run -d -p 15963:15963 --rm -it gpt-academic
最后更新于