QNAP NAS Docker 配置
记录在自己的 QNAP NAS 上 Docker 的配置。
Docker 配置
vim /share/CACHEDEV4_DATA/.qpkg/container-station/script/run-docker.sh
# 在最后两行配置上代理
export http_proxy="http://192.168.x.xxx:7890"
export https_proxy="http://192.168.x.xxx:7890"
export no_proxy= "192.168.x.0/24,localhost,127.0.0.1"
Docker Command
- shell
docker exec -it XXX bash
管理员权限运行docker exec -u 0 -it mycontainer bash
- remove
docker rm --volumes XXX
- 测试
curl -I https://google.com/
- Docker 内代理, Bridge 模式
export https_proxy=http://192.168.1.220:7890 http_proxy=http://192.168.1.220:7890
all_proxy=socks5://192.168.1.220:7890
Docker Run
自行修改挂载 volume 及 端口
alist
挂载本地磁盘、网盘,WebDAV 甚至比 QNAP 自带的稳定
docker run -dit --restart=unless-stopped -v /share/Sync-1/DockerMount/alist/data:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:latest
clash-all
懂得都懂
docker run -dit --restart=unless-stopped --name clash-all -p 7890:7890 -p 9090:9090 -e CLASH_URL="xxx" -e CLASH_SECRET="XXXXXX" jieay/clash-all
flare
导航页,不用了,不如homarr
docker run -dit --restart=unless-stopped -p 5005:5005 -v /share/Sync-1/DockerMount/app:/app soulteary/flare
qinglong
青龙面板,m-team 签到,京东薅羊毛
docker run -dit \
-v /share/Sync-1/DockerMount/ql/data:/ql/data \
-p 5700:5700 \
-e QlBaseUrl="/" \
-e QlPort="5700" \
--name qinglong \
--hostname qinglong \
--restart unless-stopped \
whyour/qinglong:latest
joplin
自建 joplin,没啥用不如用 WebDAV 同步
version: '3'
services:
db:
image: postgres:13
volumes:
- ./data/postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=joplin
- POSTGRES_USER=joplin
- POSTGRES_DB=joplin
app:
image: joplin/server:latest
depends_on:
- db
ports:
- "22300:22300"
restart: unless-stopped
environment:
- APP_PORT=22300
- APP_BASE_URL=https://xxx.xxx.com
- DB_CLIENT=pg
- POSTGRES_PASSWORD=joplin
- POSTGRES_DATABASE=joplin
- POSTGRES_USER=joplin
- POSTGRES_PORT=5432
- POSTGRES_HOST=db
homeassistant
智能家居
docker run -d \
--restart always \
--name homeassistant \
-v /share/Sync-1/DockerMount/homeassistant/config:/config \
-e TZ=Asia/Shanghai \
-p 8123:8123 \
homeassistant/home-assistant:latest
mariadb
真MySQL
docker run -d \
--name mariadb \
-v /share/Sync-1/DockerMount/mariadb/data/:/var/lib/mysql/ \
-e MYSQL_ROOT_PASSWORD=XXXXXX \
-p 3307:3306 \
mariadb
phpmyadmin
时代的眼泪
docker run -d \
--name phpmyadmin \
-e PMA_HOST=mariadb \
-p 8001:80 \
-h phpmyadmin \
--restart=always \
--link mariadb \
phpmyadmin/phpmyadmin:latest
wordpress
暂时不用 wordpress 建站,有些太重了
docker run -d \
--link mariadb \
--name wordpresslink \
-p 8884:80 \
-e WORDPRESS_DB_HOST=10.0.3.5:3306 \
-e WORDPRESS_DB_NAME=wordpresslink \
-e WORDPRESS_DB_USER=links \
-e WORDPRESS_DB_PASSWORD=XXXXXX \
-v /share/Sync-1/DockerMount/wordpress/wordpresslink/html:/var/www/html \
-v /share/Sync-1/DockerMount/wordpress/wordpresslink/config/:/config \
wordpress
homarr
极其推荐的导航页,导航 docker,控制 homeassistant 等诸多功能
docker run \
--name homarr \
--restart unless-stopped \
-p 7575:7575 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /share/Sync-1/DockerMount/homarr/homarr/configs:/app/data/configs \
-v /share/Sync-1/DockerMount/homarr/homarr/data:/data \
-v /share/Sync-1/DockerMount/homarr/homarr/icons:/app/public/icons \
-d ghcr.io/ajnart/homarr:latest
dashdot
检测 NAS 硬件状态
docker run -it \
--name dashdot \
--restart unless-stopped \
-p 3001:3001 \
-v /:/mnt/host:ro \
--privileged \
-e DASHDOT_WIDGET_LIST=os,cpu,storage,ram,network \
mauricenino/dashdot
RSSHub
自建 RSSHub 解决🪜问题
version: "3.9"
services:
rsshub:
# two ways to enable puppeteer:
# * comment out marked lines, then use this image instead: diygod/rsshub:chromium-bundled
# * (consumes more disk space and memory) leave everything unchanged
image: diygod/rsshub
restart: always
ports:
- "1200:1200"
environment:
NODE_ENV: production
CACHE_TYPE: redis
REDIS_URL: "redis://redis:6379/"
PUPPETEER_WS_ENDPOINT: "ws://browserless:3000" # marked
ALLOW_ORIGIN: "*"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:1200/healthz"]
interval: 30s
timeout: 10s
retries: 3
depends_on:
- redis
- browserless # marked
extra_hosts:
- 'host.docker.internal:host-gateway'
browserless: # marked
image: browserless/chrome # marked
restart: always # marked
ulimits: # marked
core: # marked
hard: 0 # marked
soft: 0 # marked
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/pressure"]
interval: 30s
timeout: 10s
retries: 3
extra_hosts:
- 'host.docker.internal:host-gateway'
redis:
image: redis:alpine
restart: always
volumes:
- /share/Sync-1/DockerMount/redis/redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 5
start_period: 5s
volumes:
redis-data:
freshrss
自建 RSS 管理后端,iOS Mac NetNewsWire、Android FeedMe 可使用。
可以配置代理访问 RSS 源,十分推荐。
docker run --name freshrss -e PUID=1000 -e PGID=1000 -e TZ=Asia/Shanghai -v /share/Sync-1/DockerMount/FreshRSS/config:/config -p 11180:80 --restart unless-stopped lscr.io/linuxserver/freshrss:latest
openspeedtest
测速服务
docker run --restart=unless-stopped --name openspeedtest -d -p 43000:3000 openspeedtest/latest