Files
Obsidian-Main/00. Inbox/Linux/架站/filebrowser.md

52 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# docker-compose.yml
```yml
version: '3'
services:
file-browser:
restart: always
image: filebrowser/filebrowser:latest
container_name: filebrowser
user: 1000:1000
ports:
- 8040:80
volumes:
- /media/share:/srv
- ./data/filebrowser.db:/database.db
- ./data/settings.json:/.filebrowser.json
- ./data/gafiled.png:/config/logo.png
- ./data/branding:/branding
security_opt:
- no-new-privileges:true
```
# 準備
`docker compose up -d` 之前,需要先把檔案準備好。
```shell
touch data/filebrowser.db
touch data/settings.json
```
`data/settings.json` 的內容:
```json
{
"port": 80,
"baseURL": "",
"address": "",
"log": "stdout",
"database": "/database.db",
"root": "/srv"
}
```
# 登入
預設的帳號密碼是`admin/admin`,記得要改掉。
# 問題
因為Filebrowser會lock DB所以docker在跑得時候會無法使用Filebrowser的command所以需要先把docker停掉然後用以下命令登入
```shell
sudo docker run -it -v ./data/filebrowser.db:/database.db -v data/settings.json:/.filebrowser.json --entrypoint /bin/sh filebrowser/filebrowser
```
# 參考
- [Filebrowser Docker Installation | All about](https://bobcares.com/blog/filebrowser-installation-in-docker/)
- [filebrowser/filebrowser: 📂 Web File Browser](https://github.com/filebrowser/filebrowser)