Docker Compose部署filebrowser

在linuxserver服务器上安装 环境:docker、docker- compose 需要了解docker基本知识,不懂可以翻翻以前的博客或者搜下教程学习 filebrowser官网上给的是docker命令执行的,但用compose习惯了,所以转换了一下格式,但是这里有个坑,官网也提示了 By default, we already have a configuration file with some defaults so you can just mount the root and the database. Although you can overwrite by mounting a directory with a new config file. If you don’t already have a database file, make sure to create a new empty file under the path you specified. Otherwise, Docker will create an empty folder instead of an empty file, resulting in an error when mounting the database into the container. 翻译过来就是需要提前创建所需的文件和文件夹,否则,Docker会创建一个空的文件夹而不是空的文件,导致在将数据库挂载到容器中时出现错误!这点一定要注意啊!!! 1、创建docker-compose文件 内容如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 version: '3.3' services: filebrowser: image: filebrowser/filebrowser:s6 container_name: filebrowser volumes: - ./root:/srv - ./database/filebrowser.db:/database/filebrowser.db - ./settings.json:/config/settings.json environment: - PUID=0 - PGID=0 ports: - '8080:80' restart: always 2、创建默认文件和文件夹 对照上述docker-compose的路径,需要在当前目录创建 settings.json 文件,内容如下: 1 2 3 4 5 6 7 8 { "port": 80, "baseURL": "", "address": "0.0.0.0", "log": "stdout", "database": "/database/filebrowser.db", "root": "/srv" } 在当前目录创建 database/filebrowser....

创建: 2022-01-21 | 更新: 2024-04-29 | 字数: 242字 | 时长: 2分钟 | 作者:张三