跳转至

07Docker部署-其它折腾

记录一些我折腾过的应用,但是并不常用,常用的话我会单独提取出来,放到单独的文章。

微信公众号 Markdown 排版类

1.doocs

github: https://github.com/doocs/md

docker run -d -p 8080:80 doocs/md:latest

或者 docker-compose.yml

version: "3"
services:
  doocs:
    image: doocs/md:latest
    ports:
      - "8083:80"
    container_name: doocs
    restart: unless-stopped

然后打开浏览器,输入http://ip地址:8080访问。我虚拟机的 ip 地址是192.168.56.101

2.mdnice

github:https://github.com/mdnice/markdown-nice

docker 命令:

docker run -d --name mdnice -p 8081:80 ibegyourpardon/md-nice-plus:latest

或者 docker-compose

version: "3"
services:
  mdnice:
    image: ibegyourpardon/md-nice-plus:latest
    ports:
      - "8083:80"
    container_name: mdnice
    restart: unless-stopped

访问:http://192.168.56.101:8081

3. wxmp

github 仓库:https://github.com/jaywcjlove/wxmp

docker 命令一键运行

docker run --name wxmp -itd -p 8082:3000 ghcr.io/jaywcjlove/wxmp:latest

或者 docker-compose

version: "3"
services:
  wxmp:
    image: ghcr.io/jaywcjlove/wxmp:latest
    ports:
      - "8082:3000 "
    container_name: wxmp
    restart: unless-stopped

浏览器访问:http://192.168.56.101:8082

文件同步服务类

1.minio

MinIO 是一个高性能的对象存储服务,兼容 Amazon S3 API,适合用于大数据存储、备份、归档等场景。它可以通过私有部署方式来搭建一个类似于 AWS S3 的私有云存储系统

version: "3.8"

services:
  minio:
    image: "minio/minio"
    ports:
      - "9000:9000" # webUI
      - "9001:9001" # 后台
    environment:
      - MINIO_ROOT_USER=admin
      - MINIO_ROOT_PASSWORD=admin
    command: server /data --console-address ":9000" -address ":9001"
    volumes:
      - ./data:/data
      - ./.minio:/root/.minio
    networks:
      default:
        ipv4_address: 172.32.0.4
networks:
  default:
    external: true
    name: web_net

Wiki 类应用

dokuwiki

优点:可以在线多人编辑,轻量,帮助文档详细,有详细的 wiki 语法介绍,插件多,模板也多。

dokuwiki 的缺点在于不能批量导入导出笔记,比如你手上有很多个 md 笔记,想批量导入 dokuwiki,那是不行的,只能手动一个一个新建,如果你会 php 的话,可能可以自己写一下批量导入的插件。

就算你是完全手动写的,想批量导出也是不行的,你备份,得把除了你笔记源代码的文件备份之外,各种配置数据文件都要一起备份,而且如果你切换主题,一旦崩溃,那你只能重开。你新增的笔记也要一条一条的重新编写。。。

version: "3"
services:
  dokuwiki:
    container_name: dokuwiki
    image: bitnami/dokuwiki:latest
    ports:
      - 8080:8080
    environment:
      - PUID=1000
      - PGID=1000
      # - ALLOW_EMPTY_PASSWORD=yes
      - DOKUWIKI_USERNAME=admin
      - DOKUWIKI_FULL_NAME=admin
      - DOKUWIKI_PASSWORD=admin
      - DOKUWIKI_EMAIL=admin@test.com
      - DOKUWIKI_WIKI_NAME=我的知识库
      - PHP_DEFAULT_MEMORY_LIMIT=256M

    volumes:
      - ./data:/bitnami/dokuwiki

mediawiki

这个,对于个人来说,可能有点复杂,用 sqlite 作为数据库的话,在最初数据量不是很多的时候,占用资源不算太多。数据量一多、或者换成 mysql 等数据库,就可能需要更多的硬件资源了。

version: "3"

services:
  mediawiki:
    restart: always
    image: mediawiki
    labels:
      - "traefik.enable=true"
      - "traefik.frontend.rule=Host:mediawiki.lab.io"
      - "traefik.frontend.passHostHeader=true"
      - "traefik.frontend.entryPoints=http,https"
    # ports:
    #   - 7880:80
    volumes:
      # 默认上传位置
      - ./uploads/images:/var/www/html/images
      # 默认 SQLite 储存位置
      - ./data:/var/www/data
      #  向导安装完成之后,把LocalSettings.php复制到当前文件夹之后吧,取消下面一行的注释,重新启动容器
      # - ./LocalSettings.php:/var/www/html/LocalSettings.php
    networks:
      default:
        ipv4_address: 172.32.0.9
networks:
  default:
    external: true
    name: web_net

运行之后,访问http://ip:7880;进向导安装,

安装的时候,为了方便体验,直接选择 sqlite

安装出现无法创建,说明对目录没有访问权限,

赋予 data、uploads 文件夹权限

chmod -R 777 data uploads

然后重新点击继续,安装完之后会让你下载一个 LocalSettings.php 文件,把这个文件复制到docker-compose.yml文件所在的当前文件夹,停止容器,重新创建就行。修改一下 docker-compose.yml 文件,取消注释

 - ./LocalSettings.php:/var/www/html/LocalSettings.php

wikijs

不习惯这个 wiki 的各种页面,可能是外国人开发的原因,对于我来了说比较反人类。当然,可能是因为不熟悉的缘故,只是创建页面的时候,就让我觉得很难受,创建一个页面需要点击的次数太多了,每新建一个新页面,都需要重新让我选编辑器,填写各种页面属性。

其实我只是想新建,然后能直接填个标题和内容就行了。个人习惯问题,用不惯。不过这个自带评论系统,还是挺不错的,在团队一起协作的时候,可以用评论的方式讨论某个页面内容

services:
  wikijs:
    image: lscr.io/linuxserver/wikijs:latest
    container_name: wikijs
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - DB_TYPE=sqlite #optional
      - DB_HOST= #optional
      - DB_PORT= #optional
      - DB_NAME= #optional
      - DB_USER= #optional
      - DB_PASS= #optional
    volumes:
      - ./config:/config
      - ./data:/data
    ports:
      - 3000:3000
    restart: unless-stopped

xwiki

资源没有个 4 核 8G 内存,慎用,这个占用资源很多,docker 启动的时候没有限制资源的使用,我 2 核 2G 的服务器直接给我干崩溃,

version: "2"
networks:
  bridge:
    driver: bridge
services:
  # The container that runs XWiki + Tomcat
  web:
    image: "xwiki:lts-postgres-tomcat"
    container_name: xwiki-postgres-tomcat-web
    depends_on:
      - db
    ports:
      - "8080:8080"
    # Default values defined in .env file.
    # The DB_USER/DB_PASSWORD/DB_DATABASE/DB_HOST variables are used in the hibernate.cfg.xml file.
    environment:
      - XWIKI_VERSION=xwiki
      - DB_USER=xwiki
      - DB_PASSWORD=xwiki
      - DB_DATABASE=xwiki
      - DB_HOST=xwiki-postgres-db
    # Provide a name instead of an auto-generated id for xwiki data (the permanent directory in included in it)
    # configured in the Dockerfile, to make it simpler to identify in 'docker volume ls'.
    volumes:
      - xwiki-data:/usr/local/xwiki
    networks:
      - bridge
  # The container that runs the database (postgres)
  db:
    image: "postgres:13"
    container_name: xwiki-postgres-db
    volumes:
      - postgres-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_ROOT_PASSWORD=xwiki
      - POSTGRES_PASSWORD=xwiki
      - POSTGRES_USER=xwiki
      - POSTGRES_DB=xwiki
      - POSTGRES_INITDB_ARGS="--encoding=UTF8"
    networks:
      - bridge
volumes:
  postgres-data: {}
  xwiki-data: {}

tiddlywiki

这个对于个人来说还是很实用的,轻量,比上面的简单很多,支持批量导入 md 文件,导出的话,还是没法批量导出。

对于服务器版本的 tiddlywiki,每个条目对应一个 tid 文件,所有文件都是放在一个目录下,没有父子目录的层级结构。比单文件版本的好的地方在于图片可以直接嵌入到 wiki 里面,单文件版本对于图片的管理比较麻烦,直接嵌入很容易导致 wiki 变卡顿。

但是没有账号角色的管理,只有一个数据文件,多人以前协作的话支持不太好。

version: "3"

services:
  tiddlywiki:
    image: nicolaw/tiddlywiki
    container_name: tiddlywiki
    restart: always
    environment:
      - TW_USERNAME=admin
      - TW_PASSWORD=admin
    ports:
      - 8081:8080
    volumes:
      - ./tiddlywiki:/var/lib/tiddlywiki

笔记类

蚂蚁笔记

version: "3.8"
services:
  web:
    container_name: leanote
    image: axboy/leanote
    ports:
      - 9800:9000
    deploy:
      resources:
        limits:
          cpus: "2.00"
          memory: 100M
        reservations:
          memory: 100M

    volumes:
      - ./data/leanote/db:/data/db
      - ./data/leanote/conf/:/data/leanote/conf
      - ./data/leanote/files:/data/leanote/files
      - ./data/leanote/upload:/data/leanote/public/upload
    restart: always
    networks:
      default:
        ipv4_address: 172.32.0.5

networks:
  default:
    external: true
    name: web_net

memos 笔记

version: "3.9"
services:
  memos:
    image: neosmemo/memos:stable
    container_name: memos
    volumes:
      - ./memos:/var/opt/memos
    # ports:
    #   - 5230:5230
    deploy:
      resources:
        limits:
          cpus: "0.20"
          memory: 200M

    networks:
      default:
        ipv4_address: 172.32.0.11
networks:
  default:
    external: true
    name: web_net

trilium

version: "3"
services:
  trilium:
    # image: zadam/trilium # 英文版
    image: nriver/trilium-cn # 中文版
    restart: always
    environment:
      - TRILIUM_DATA_DIR=/home/node/trilium-data
    # ports:
    #   - "8080:8080"
    volumes:
      - ./data:/home/node/trilium-data
    networks:
      default:
        ipv4_address: 172.32.0.10
networks:
  default:
    external: true
    name: web_net

思源笔记

docker-compose.yml文件内容如下:

version: '3.8'

services:
  siyuan:
    image: b3log/siyuan:latest
    container_name: siyuan
    restart: always
    user: '1000:1000'
    volumes:
      - ./workspace:/home/siyuan/SiYuan
    command: [--workspace=/home/siyuan/SiYuan,--lang=zh_CN,--accessAuthCode=eqMqJXE67iolzlHoP0zF8bcTuK9hVNfzRl]
    environment:
        - TZ=Asia/Shanghai
        - LANG=zh_CN.UTF-8
        - LC_ALL=zh_CN.UTF-8
    network_mode: "host"

注意:

  • 一定要修改 accessAuthCode 的值,相当于密码,可以自己随便生成 不设置的话,所有人都能看到并修改你的笔记了

图床类

兰空图床

version: "3"
services:
  lsky-pro:
    container_name: lsky-pro
    image: dko0/lsky-pro
    restart: always
    volumes:
      - ./data/html:/var/www/html #映射到本地
    ports:
      - 7791:80
    environment:
      - MYSQL_HOST=mysql
      - MYSQL_DATABASE=lsky-pro
      - MYSQL_USER=lsky-pro
      - MYSQL_PASSWORD=lsky-pro

  mysql:
    image: mysql:8.0
    container_name: lsky-pro-db
    restart: always
    environment:
      - MYSQL_DATABASE=lsky-pro
      - MYSQL_USER=lsky-pro
      - MYSQL_PASSWORD=lsky-pro
      - MYSQL_ROOT_PASSWORD=lsky-pro
    volumes:
      - ./data/db:/var/lib/mysql

Bug 跟踪管理

禅道

version: '3.7'

services:
  Zentao:
    image: hub.zentao.net/app/zentao
    container_name: Zentao
    restart: always
    environment:
      - MYSQL_INTERNAL=true
      # mysql默认用户名:root,123456
    # ports:
    #   - 80:80
    volumes:
      - ./data:/data
    deploy:
      resources:
        limits:
          cpus: '0.50'
          memory: 1024M
    networks:
      default:
        ipv4_address: 172.32.0.12
networks:
  default:
    external: true
    name: web_net

redmine

version: '2'

services:
  redmine:
    build: ./
    image: sameersbn/redmine:4.2.4
    environment:
    - TZ=Asia/Kolkata

    - DB_ADAPTER=sqlite3
    - DB_NAME=db.sqlite3

    - REDMINE_PORT=80
    - REDMINE_HTTPS=false
    - REDMINE_RELATIVE_URL_ROOT=
    - REDMINE_SECRET_TOKEN=

    - REDMINE_SUDO_MODE_ENABLED=false
    - REDMINE_SUDO_MODE_TIMEOUT=15

    - REDMINE_CONCURRENT_UPLOADS=2

    - REDMINE_BACKUP_SCHEDULE=
    - REDMINE_BACKUP_EXPIRY=
    - REDMINE_BACKUP_TIME=

    - SMTP_ENABLED=false
    - SMTP_METHOD=smtp
    - SMTP_DOMAIN=www.example.com
    - SMTP_HOST=smtp.gmail.com
    - SMTP_PORT=587
    - SMTP_USER=mailer@example.com
    - SMTP_PASS=password
    - SMTP_STARTTLS=true
    - SMTP_AUTHENTICATION=:login

    - IMAP_ENABLED=false
    - IMAP_HOST=imap.gmail.com
    - IMAP_PORT=993
    - IMAP_USER=mailer@example.com
    - IMAP_PASS=password
    - IMAP_SSL=true
    - IMAP_INTERVAL=30

    # ports:
    # - "80:80"
    volumes:
    - ./redmine_sqlite:/home/redmine/data
    - ./redmine-logs:/var/log/redmine
    networks:
      default:
        ipv4_address: 172.32.0.10
networks:
  default:
    external: true
    name: web_net

评论