Docker compose 应用集
🌈Docker 文件的应用,之前分开太过杂乱,现整合,并保持更新;
如果是 Linux 按个人习惯将会把
🧷docker-compose.yaml
放至🗂️/opt/<project_name>/
下
📦️Mariadb
Maridb 比 MySQL 更好用的数据库
🧷docker-compose.yaml
services:
mariadb:
image: mariadb:10.6
container_name: mariadb
restart: always
network_mode: bridge
environment:
MARIADB_ROOT_PASSWORD: "root"
MARIADB_DATABASE: "halo"
TZ: "Asia/Shanghai"
ports:
- "3306:3306"
volumes:
- ./data:/var/lib/mysql
- ./log:/var/log/mysql
🧿Halo
halo 博客 2.20以上版本提示太烦了
🧷docker-compose.yaml
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.20.12
container_name: halo
restart: on-failure:3
network_mode: host
volumes:
- ./halo2:/root/.halo2
command:
# 修改为自己已有的数据库配置
- --spring.r2dbc.url=r2dbc:pool:mariadb://localhost:3306/halodb
- --spring.r2dbc.username=root
- --spring.r2dbc.password=root
- --spring.sql.init.platform=mariadb
# 外部访问地址,请根据实际需要修改
- --halo.external-url=http://localhost:8090/
# 端口号 默认8090
- --server.port=8090
🗄️Immich
Immich 是一个非常好用的开源的照片管理工具,支持 iOS 和 Android App. 由于
🗄️immich
依赖的服务比较多,使用官方推荐使用 Compose 的方式来安装。 首先从 immich 官网 下载配置文件:🧷docker-compose.yml,🧷example.env 也可以按照下面文件编写【与官方相同,删除英文注释,修改上传照片路径,数据库路径即可】
{% link https://immich.app/ immich icon:https://immich.app/img/feature-panel.png %}
将
🧷example.env
与🧷docker-compose.yaml
放至相同路径文件夹下;将
🧷example.env
重命名为🧷.env
;docker compose up -d
等待完成即可。
🧷example.env
# 上传照片路径
UPLOAD_LOCATION=/home/immich/Photo
# 数据库路径
DB_DATA_LOCATION=/home/immich/db
# 时区 中国上海
TZ=Asia/Shanghai
# 版本
IMMICH_VERSION=release
# 数据库:用户密码数据库名
DB_PASSWORD=postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
🧷docker-compose.yaml
name: immich
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- $PWD/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- '2283:2283'
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: '--data-checksums'
volumes:
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
healthcheck:
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
interval: 5m
start_interval: 30s
start_period: 5m
command:
[
'postgres',
'-c',
'shared_preload_libraries=vectors.so',
'-c',
'search_path="$$user", public, vectors',
'-c',
'logging_collector=on',
'-c',
'max_wal_size=2GB',
'-c',
'shared_buffers=512MB',
'-c',
'wal_compression=on',
]
restart: always
volumes:
model-cache:
📽️Emby
开心版😀
🧷docker-compose.yaml
services:
emby:
container_name: emby
network_mode: bridge
volumes:
- ./config:/config
- ./media:/media # 自己的媒体路径
ports:
- 8096:8096
environment:
- NO_PROXY=172.17.0.1,127.0.0.1,localhost
- ALL_PROXY=http://192.168.110.200:7890
- HTTP_PROXY=http://192.168.110.200:7890
devices:
- /dev/dri:/dev/dri
restart: always
image: amilys/embyserver:beta
🐈⬛Clash & Yacd
https://hexo.uain.cc/2024/03/21/Docker-compose-%E5%BA%94%E7%94%A8%E9%9B%86/#%F0%9F%90%88%E2%80%8D%E2%AC%9BClash-Yacd
🎵Navidrome
建议搭配 MusicTag 使用
🧷docker-compose.yaml
services:
navidrome:
image: deluan/navidrome:latest
container_name: navidrome
network_mode: bridge
ports:
- 4533:4533 #左侧端口如有冲突,可随意修改
volumes:
- "$PWD/data:/data"
- "/home/media/music:/music:ro"
environment:
#程序默认语言
- ND_DEFAULTLANGUAGE=zh-Hans
#启用GRAVATAR头像
- ND_ENABLEGRAVATAR=true
#关闭转码,如需要转码请设置为true
- ND_ENABLETRANSCODINGCONFIG=false
#SPOTIFY相关
# - ND_SPOTIFY_ID=
# - ND_SPOTIFY_SECRET=
#LAST.FM相关
# - ND_LASTFM_LANGUAGE=zh
# - ND_LASTFM_APIKEY=
# - ND_LASTFM_SECRET=
#PROXY相关
- HTTP_PROXY=http://192.168.0.168:7890
- HTTPS_PROXY=http://192.168.0.168:7890
restart: unless-stopped
📚️Reader
Docker 阅读,看小说的
🧷docker-compose.yaml
services:
reader:
image: hectorqin/reader
#image: hectorqin/reader:openj9-latest #docker镜像,arm64架构或小内存机器优先使用此镜像.启用需删除上一行
container_name: reader
network_mode: bridge
restart: always
ports:
- 7777:8080
volumes:
- $PWD/logs:/logs #log映射目录 /home/reader/logs 映射目录可自行修改
- $PWD/storage:/storage #数据映射目录 /home/reader/storage 映射目录可自行修改
environment:
- SPRING_PROFILES_ACTIVE=prod
- READER_APP_USERLIMIT=5 #用户上限,默认50
- READER_APP_USERBOOKLIMIT=200 #用户书籍上限,默认200
- READER_APP_CACHECHAPTERCONTENT=true #开启缓存章节内容 V2.0
# 下面都是多用户模式配置
- READER_APP_SECURE=true #开启登录鉴权,开启后将支持多用户模式
- READER_APP_SECUREKEY=adminpw #管理员密码 建议修改
- READER_APP_INVITECODE=0000 #注册邀请码 建议修改,如不需要可注释或删除