Docker Compose
是一个功能强大且易于使用的工具,可以极大地简化容器化应用程序的部署和管理过程。通过定义一个简单的 YAML
文件,用户可以轻松地描述应用程序的架构和依赖关系,并使用一条命令即可启动、停止或重新构建整个应用程序。
1.1、创建文件夹
1
| mkdir -p ~/.docker/memos/data
|
1.2、编辑 docker-compose.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| services: memos: image: neosmemo/memos:stable container_name: memos restart: unless-stopped volumes: - ./data:/var/opt/memos ports: - 5230:5230 networks: memos_network: environment: MEMOS_PUBLIC: false networks: memos_network:
|
2024/07/18 v0.22.3 版本增加环境变量禁用注册。
1.3、启动 memos
1.4、升级
2.1、创建文件夹
1
| mkdir -p ~/.docker/shaarli
|
2.2、编辑 docker-compose.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| services: shaarli: image: shaarli/shaarli:latest container_name: shaarli restart: unless-stopped volumes: - ./data:/var/www/shaarli/data - ./cache:/var/www/shaarli/cache - ./plugins:/var/www/shaarli/plugins - ./tpl:/var/www/shaarli/tpl ports: - 8000:80 networks: shaarli_network: networks: shaarli_network:
|
需要注意的是,插件和主题文件夹内容不能为空,去作者仓库 https://github.com/shaarli/Shaarli/releases 下载最新版本压缩包,然后把插件和主题文件夹的内容上传到服务器,这两个文件夹不需要设置权限,默认权限可以读取即可。
2.3、启动 shaarli
访问网页时报错,调整文件夹权限,强制刷新网页
1 2
| docker exec -it shaarli chown -R nginx:nginx /var/www/shaarli/data docker exec -it shaarli chown -R nginx:nginx /var/www/shaarli/cache
|
2.4、升级
3.1、创建文件夹
1
| mkdir -p ~/.docker/freshrss
|
3.2、编辑 docker-compose.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| services: freshrss: image: freshrss/freshrss:latest container_name: freshrss restart: unless-stopped volumes: - ./freshrss_data:/var/www/FreshRSS/data - ./freshrss_extensions:/var/www/FreshRSS/extensions ports: - 8008:80 environment: TZ: Asia/Shanghai CRON_MIN: '2,16,32,45,58' FRESHRSS_ENV: development networks: freshrss_network: networks: freshrss_network:
|
3.4、升级
4.1、创建文件夹
1
| mkdir -p ~/.docker/alist/data
|
4.2、编辑 docker-compose.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| services: alist: image: xhofe/alist:latest container_name: alist restart: unless-stopped volumes: - ./data:/opt/alist/data ports: - 5255:5244 environment: - PUID=0 - PGID=0 - UMASK=022 networks: alist_network: networks: alist_network:
|
4.3、启动 alist
4.4、升级
4.5、修改密码
1
| docker exec -it alist bash
|
5.1、创建文件夹
1
| mkdir -p ~/.docker/xiaoya/config
|
1
| vim ~/.docker/xiaoya/config/mytoken.txt
|
1
| vim ~/.docker/xiaoya/config/myopentoken.txt
|
- 设置 temp_transfer_folder_id
1
| vim ~/.docker/xiaoya/config/temp_transfer_folder_id.txt
|
5.2、编辑 docker-compose.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| services: xiaoya: image: xiaoyaliu/alist:latest container_name: xiaoya restart: unless-stopped volumes: - ./config:/data - ./config/data:/www/data ports: - 5678:80 - 2345:2345 - 2346:2346 networks: xiaoya_network: networks: xiaoya_network:
|
5.3、启动 xiaoya
5.4、升级
5.5、定时重启同步数据
1
| 0 6 * * * docker restart xiaoya
|