add files

This commit is contained in:
2025-03-15 20:08:48 +08:00
parent 00da211880
commit f4f28ca3f4
7 changed files with 258 additions and 0 deletions

View File

@ -0,0 +1,30 @@
---
services:
calibre-web-automated:
image: crocodilestick/calibre-web-automated:latest
container_name: calibre-web-automated
restart: unless-stopped
ports:
# Change the first number to change the port you want to access the Web UI, not the second
- 8083:8083
networks:
- devops
environment:
# Only change these if you know what you're doing
- PUID=1000
- PGID=1000
# Edit to match your current timezone https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- TZ=Asia/Shanghai # 设置时区
volumes:
# mkdir -p ~/dockers/calibre/{config,cwa-book-ingest,calibre-library}
# CW users migrating should stop their existing CW instance, make a copy of the config folder, and bind that here to carry over all of their user settings ect.
- ~/dockers/calibre/config:/config # 存储 Komga 配置和数据库
# This is an ingest dir, NOT a library one. Anything added here will be automatically added to your library according to the settings you have configured in CWA Settings page. All files placed here are REMOVED AFTER PROCESSING
- ~/dockers/calibre/cwa-book-ingest:/cwa-book-ingest # 你的电子书存储目录EPUB, PDF
# If you don't have an existing library, CWA will automatically create one at the bind provided here
- ~/dockers/calibre/calibre-library:/calibre-library # Komga 日志
networks:
devops:
external: true

45
commit.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
# 确保脚本有执行权限(只需执行一次)
# chmod +x git_commit.sh
# 检查是否在 Git 仓库内
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "❌ 当前目录不是 Git 仓库,请先执行 git init"
exit 1
fi
# 获取 commit message
commit_msg="$1"
# 如果没有提供 commit message提示用户输入
if [ -z "$commit_msg" ]; then
read -p "请输入 commit message: " commit_msg
if [ -z "$commit_msg" ]; then
echo "❌ 提交信息不能为空!"
exit 1
fi
fi
# 添加所有更改
git add .
if [ $? -ne 0 ]; then
echo "❌ git add 失败!"
exit 1
fi
# 提交更改
git commit -m "$commit_msg"
if [ $? -ne 0 ]; then
echo "❌ git commit 失败!"
exit 1
fi
# 推送到远程仓库
git push -u origin master
if [ $? -ne 0 ]; then
echo "❌ git push 失败!请检查远程仓库设置。"
exit 1
fi
echo "✅ 代码提交成功!"

24
golang-dev/Dockerfile Normal file
View File

@ -0,0 +1,24 @@
# 选择基础镜像,使用 Ubuntu 最新版本
#FROM ubuntu:latest
FROM --platform=linux/amd64 ubuntu:latest
# 设置时区,避免交互式输入
ENV DEBIAN_FRONTEND=noninteractive
# 安装基础工具和 Golang
RUN apt-get update && apt-get install -y \
curl wget git vim build-essential \
&& rm -rf /var/lib/apt/lists/*
# 安装 Golang
RUN wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz && \
rm go1.22.2.linux-amd64.tar.gz
# 配置 Golang 环境变量
ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOPATH="/root/go"
ENV PATH="${GOPATH}/bin:${PATH}"
# 设置默认命令,进入 shell
CMD ["/bin/bash"]

View File

@ -0,0 +1,41 @@
---
services:
golang-dev:
image: golang-dev:latest # 指定了镜像名
build:
context: .
dockerfile: Dockerfile
container_name: golang-dev
restart: unless-stopped
networks:
- devops # 你之前创建的 devops 网络
ports:
- "2080:80"
volumes:
- ~/Documents/codes/golang:/root/projects # 挂载git工程目录
# mkdir -p ~/dockers/golang-dev/{hostdir,go-mod,.ssh}
# touch ~/dockers/golang-dev/.gitconfig
- ~/dockers/golang-dev/hostdir:/root/hostdir # 挂载一个通用的主机目录
- ~/dockers/golang-dev/go-mod:/root/go # 挂载一个go pkg 目录
- ~/dockers/sharedata:/root/sharedata # 挂载一个docker之间共享的目录
- ~/dockers/golang-dev/.ssh:/root/.ssh # 允许 SSH 访问 git 仓库
- ~/dockers/golang-dev/.gitconfig:/root/.gitconfig # 共享 Git 配置文件
environment:
- TZ=Asia/Shanghai # 设置时区
stdin_open: true
tty: true
# docker-compose build # 重新构建镜像
# docker-compose up -d # 运行最新的容器
# docker-compose up -d --build
# docker image prune -f # 批量删除未被容器使用的旧镜像
# docker image prune -a -f # 删除所有未使用的镜像(包括 dangling 和 unreferenced 镜像)
networks:
devops:
external: true # 你已有的 devops 网络

22
komga/docker-compose.yml Normal file
View File

@ -0,0 +1,22 @@
version: "3.8"
services:
komga:
image: gotson/komga:latest
container_name: komga
restart: unless-stopped
networks:
- devops
ports:
- "25600:25600" # 访问地址: http://localhost:25600
environment:
- TZ=Asia/Shanghai # 设置时区
volumes:
# mkdir -p ~/dockers/komga/{config,books,logs}
- ~/dockers/komga/config:/config # 存储 Komga 配置和数据库
- ~/dockers/komga/books:/books # 你的电子书存储目录EPUB, PDF
- ~/dockers/komga/logs:/logs # Komga 日志
networks:
devops:
external: true

View File

@ -0,0 +1,63 @@
version: "3.8"
services:
paperless:
image: ghcr.io/paperless-ngx/paperless-ngx:latest
container_name: paperless
restart: unless-stopped
ports:
- "8000:8000"
environment:
PAPERLESS_OCR_LANGUAGES: "" # 跳过OCR
PAPERLESS_OCR_SKIP_ARCHIVE_FILE: "always" # 跳过创建文档存档版本的时间
PAPERLESS_OCR_OUTPUT_TYPE: "pdf" # 尽量少修改PDF文档
PAPERLESS_CONSUMER_POLLING: "5" # 指定轮询间隔(以秒为单位),这将导致 paperless 定期检查消费目录中的更改
#PAPERLESS_CONSUMER_INOTIFY_DELAY: "2" # 设置消费者等待 inotify 发出的其他事件的时间(以秒为单位)
# 使用 SQLite 作为数据库(默认)
PAPERLESS_DBENGINE: sqlite3
PAPERLESS_DBNAME: /usr/src/paperless/db/paperless.sqlite3
PAPERLESS_REDIS: redis://redis:6379
# 语言和时区设置
PAPERLESS_TIME_ZONE: Asia/Shanghai
PAPERLESS_LANGUAGE: zh-cn
# PDF 处理的目录
PAPERLESS_CONSUMPTION_DIR: /usr/src/paperless/consume
PAPERLESS_DATA_DIR: /usr/src/paperless/data
PAPERLESS_MEDIA_ROOT: /usr/src/paperless/media
PAPERLESS_EXPORT_DIR: /usr/src/paperless/export
# 定义文件命名规则和存储路径
# 作用不大,主要还是用消费后脚本,以及工作流来指定存储路径。
# 工作流先于消费后脚本运行因此消费后脚本里解析的document_type在工作流里无效。所以使用了文件名关键词匹配
PAPERLESS_FILENAME_FORMAT: "{{created}}_{{document_type}}_{{correspondent}}_{{title}}.pdf"
# 解析文件里的关键信息并更新。但无法更新strorage path。这个字段要靠工作流才行。
PAPERLESS_POST_CONSUME_SCRIPT: "/usr/src/paperless/scripts/parse_filename.py"
# 运行用户
USERMAP_UID: 1000
USERMAP_GID: 1000
volumes:
# 存储所有数据搜索索引、SQLite 数据库、分类模型等)的地方
- ~/dockers/paperless/data:/usr/src/paperless/data
# 挂载文件导入目录
- ~/dockers/paperless/consume:/usr/src/paperless/consume
# 挂载文件导出目录
- ~/dockers/paperless/export:/usr/src/paperless/export
# 存储您的文档和缩略图的地方
- ~/dockers/paperless/media:/usr/src/paperless/media
# 挂载脚本,比如 PAPERLESS_POST_CONSUME_SCRIPT
- ~/dockers/paperless/scripts:/usr/src/paperless/scripts
networks:
- devops
networks:
devops:
external: true

View File

@ -0,0 +1,33 @@
---
services:
# main service
talebook:
image: talebook/talebook
restart: unless-stopped
ports:
# Change the first number to change the port you want to access the Web UI, not the second
- 10080:80
- 10443:443
networks:
- devops
# mkdir -p ~/dockers/talebook/{config,data}
volumes:
- ~/dockers/talebook/data:/data
- ~/dockers/talebook/config:/config
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Shanghai
depends_on:
- douban-rs-api
# optional, for meta plugins
# please set "http://douban-rs-api" in settings
douban-rs-api:
restart: always
image: ghcr.io/cxfksword/douban-api-rs
networks:
devops:
external: true