---
aliases: 
atlas: "[[Atlas/Card|Card]]"
created: 2024-03-06 18:50:29
modified: 2024-10-06 16:37:27
tags: 
title: OpenWrt Docker
---

# OpenWRT 安装 Docker Compose

通过 SSH 连接上 OpenWRT 后，在命令行内依次输入以下代码即可

```shell
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.20.2/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
```

第三行命令中的 docker 可以根据官方 GitHub 中的 releases 自行选择其它版本

# Protainer

```shell
docker run -d -p 8000:8000 -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /root/portainer:/data portainer/portainer-ce:latest
```

# Navidrome

```yaml
version: "3"
services:
  navidrome:
    image: deluan/navidrome:latest
    ports:
      - "4533:4533"
    environment:
      ND_SCANSCHEDULE: 1m
      ND_LASTFM_ENABLED:
      ND_LASTFM_APIKEY: 13db7c8e9461900659abc43f324e6d37
      ND_LASTFM_SECRET: 85c7b014b310dd25059a54be9fa87335
      ND_SPOTIFY_ID: e969f77db8244eb88e24493214a66078
      ND_SPOTIFY_SECRET: 6686da55e80945d9819f9079d098594b
      ND_LASTFM_LANGUAGE: zh
      ND_LOGLEVEL: info
      ND_SESSIONTIMEOUT: 24h
      ND_BASEURL: ""
    volumes:
      - "/root/navidrome:/data"
      - "/mnt/sata3-1/download/music:/music:ro"
```

# Fressrss

```yaml
version: "3"

services:
  freshrss-db:
    image: postgres:latest
    container_name: freshrss-db
    hostname: freshrss-db
    restart: unless-stopped
    volumes:
      - freshrss-db:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: freshrss
      POSTGRES_PASSWORD: freshrss
      POSTGRES_DB: freshrss

  freshrss-app:
    image: freshrss/freshrss:latest
    container_name: freshrss-app
    hostname: freshrss-app
    restart: unless-stopped
    ports:
      - "8686:80"
    depends_on:
      - freshrss-db
    volumes:
      - /mnt/usb3-1/freshrss/data:/var/www/FreshRSS/data
      - /mnt/usb3-1/freshrss/extensions:/var/www/FreshRSS/extensions
    environment:
      CRON_MIN: '*/60'
      TZ: Asia/Shanghai

volumes:
  freshrss-db:
```

# qBittorrent

```yaml
services:
  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - WEBUI_PORT=8080
      - TORRENTING_PORT=6881
    volumes:
      - /root/config:/config
      - /mnt/sata3-1/download:/downloads
    ports:
      - 8081:8081
      - 6881:6881
      - 6881:6881/udp
    restart: unless-stopped
```

# Bitwardenrs

```shell
docker run -d --name bitwardenrs \
  --restart unless-stopped \
  -e SIGNUPS_ALLOWED=false \
  -e WEBSOCKET_ENABLED=true \
  -v /www/wwwroot/demo/:/data/ \
  -p 6666:80 \
  -p 3012:3012 \
  vaultwarden/server:latest
```

# Lsky

```shell
docker run -d \
    --name lsky-pro \
    --restart unless-stopped \
    -p 8089:8089 \
    -v /mnt/usb3-1/lsky-pro:/var/www/html \
    -e WEB_PORT=8089 \
    halcyonazure/lsky-pro-docker:latest
```

# Gitea

```yaml
version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
    restart: always
    networks:
      - gitea
    volumes:
      - /mnt/usb3-1/gitea:/data
    ports:
      - "3333:3000"
      - "222:22"
```

重新部署 Docker 后，将仓库拷贝进对应挂载目录，在 Portainer 里进入 Console 输入 `chown -R git:git /data` 赋予 git 用户权限，再转到 Gitea 的网页端管理后台执行【重新同步所有仓库的 pre-receive、update 和 post-receive 钩子】，随后到【代码仓库-未收录仓库】中单击搜索将仓库添加进 Gitea 即可

# Rsshub

`docker run -d --name rsshub -p 1200:1200 diygod/rsshub`

# Watchtower

```shell
docker run -d \
    --name watchtower \
    --restart unless-stopped \
    -v /var/run/docker.sock:/var/run/docker.sock \
    containrrr/watchtower -c \
    --schedule "0 0 3 * * *"
```

# Reader

`docker run -d --restart=always --name=reader -v /mnt/usb3-1/reader/logs:/logs -v /mnt/usb3-1/reader/storage:/storage -p 4567:8080 hectorqin/reader java -jar /app/bin/reader.jar --spring.profiles.active=prod --reader.app.secure=true --reader.app.secureKey=Saligia7 --reader.app.inviteCode=Saligia7`

# Immich

```yaml
version: '3.8'

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: ['start.sh', 'immich']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - stack.env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    command: ['start.sh', 'microservices']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - /mnt/sata3-1/immich/model-cache:/cache
    env_file:
      - stack.env
    restart: always

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
    restart: always

  database:
    container_name: immich_postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - /mnt/sata3-1/immich/pgdata:/var/lib/postgresql/data
    restart: always
```

# Uptime-Kuma

`docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:latest`

# Kplayer

`docker run  --name=kplayer -v/mnt/usb3-1/kplayer/video:/video -v  /mnt/usb3-1/kplayer/config.json:/kplayer/config.json -v /mnt/usb3-1/kplayer/cache:/kplayer/cache  --restart=always bytelang/kplayer:latest `

