[5 Mins Docker] Deploy Zfile into Cloud – An Online Cloud Disk Listing Program
This post shows you how to deploy zfile using Docker. It demonstrates the steps deploying to online cloud providers such as fly.io, Zeahur, Koyeb, .
Zfile
Github: https://github.com/zfile-dev/zfile
ZFile is an online cloud disk (directory list) program suitable for individuals. It can unify your storage sources of various storage types into one web page for viewing, previewing, and maintenance. You no longer need to log in to various web pages to manage files. Now you only need to use it in ZFile. You only need to fill in the relevant information of the storage source. Other token refreshes and authorizations are as automated as possible, and there are complete documents to help you use it.
- Supports docking with S3, OneDrive, SharePoint, Google Drive, Duoji Cloud, Youpai Cloud, local storage, FTP, SFTP and other storage sources
- Supports online browsing of pictures, playing of audio and video, text files, Office, obj (3d) and other file types.
Demo site: https://demo.zfile.vip
System features:
Docker
,Docker Compose
support (amd64/arm64)- Responsive design, multi-terminal compatibility
- Support file operations: upload, download, rename, delete, create new folder, etc.
- Same operation experience as local files, supports drag-and-drop selection,
Ctrl + Left Mouse click
multiple selection,Shift + single click
multiple selection,Ctrl + A
select all, andEsc
deselect all - The upload experience is the same as local files, supporting
Ctrl + V
pasting and dragging to upload files/folders . - Image gallery mode, and supports customizing the number of columns, spacing, and other information.
- Folder encryption
- Contents
readme
Documentation - File/Folder Hiding
- Custom
js
,css
- Support online browsing of text files, PDF, pictures, music, and videos (support mp4, flv, hls)
- File direct link and QR code
- Mount multiple storage policies simultaneously
- Supports S3 protocol, Alibaba Cloud OSS, FTP, Huawei Cloud OBS, local storage, MINIO, OneDrive International/Home/Personal/21Vianet/SharePoint, , Qiniu Cloud KODO, Tencent Cloud COS, and Youpai Cloud USS.
Docker image: http://docker.io/zhaojun1998/zfile
Docker Run & Docker compose
Docker Run
Docker Compose:
- mkdir -p /root/data/docker_data/zfile
- cd /root/data/docker_data/zfile
- nano docker-compose.yml
Other Related Commands:
- lsof -i:8080 #check if 8080 port has been occupied,if yes, change to different one, such as 8090
- apt install lsof #install lsof
- cd /root/data/docker_data/zfile
- docker-compose up -d
Enterhttp://ip:8080
to visit the site.
Update
Uninstall
Fly.io
https://fly.io/docs/about/pricing/#free-allowances
New sign up for fly.io will have to pay $5 to stay a Hobby plan after you used up $5 free trial credit. But Legacy Hobby Plan still has no monthly subscription fee.
- Up to 3 shared-cpu-1x 256mb VMs
- 3GB persistent volume storage (total)
- 160GB outbound data transfer
PS C:/Users/WDAGUtilityAccount> flyctl auth login Opening https://fly.io/app/auth/cli/8e426809a69c7d38e2ca77e0f62ae57 ... Waiting for session... Done successfully logged in as [email protected]
You will be prompted a login window in a browser. You can use either Github or Google account to login. After logged in successfully, your flyctl should be connected to your account, as show below.
PS C:/Users/john> iwr https://fly.io/install.ps1 -useb | iex Downloading flyctl... flyctl was installed successfully to C:/Users/john/.fly/bin/flyctl.exe Run 'flyctl --help' to get started PS C:/Users/john>
PS C:/Users/john> fly launch Scanning source code Could not find a Dockerfile, nor detect a runtime or framework from source code. Continuing with a blank app. Creating app in C:/Users/john We're about to launch your app on Fly.io. Here's what you're getting: Organization: Johnny Netsec (fly launch defaults to the personal org) Name: john-ancient-flower-3833 (generated) Region: Toronto, Canada (this is the fastest region for you) App Machines: shared-cpu-1x, 1GB RAM (most apps need about 1GB of RAM) Postgres: <none> (not requested) Redis: <none> (not requested) Tigris: <none> (not requested) ? Do you want to tweak these settings before proceeding? No Created app 'john-ancient-flower-3833' in organization 'personal' Admin URL: https://fly.io/apps/john-ancient-flower-3833 Hostname: john-ancient-flower-3833.fly.dev Wrote config file fly.toml PS C:/Users/john>
- Create An App:
fly launch
- Deploy An App:
fly deploy
- Manage App Secrets:
fly secrets
- View your App:
fly open
Modify fly.toml
PS C:/Users/john> cat fly.toml
# fly.toml app configuration file generated for john-ancient-flower-3833 on 2025-01-22T07:43:31-05:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'john-ancient-flower-3833'
primary_region = 'yyz'
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
PS C:/Users/john>
We have not deploied it yet. Lets modify this fly.toml file to following example for deploying zfile:
app = "51zfile" # change to whatever name you want if the name is not occupied
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
image = "zhaojun1998/zfile" # Do not change unless you build your own image
[env]
[mounts]
source="51zfile" # change to your fly.io volume name created in next section
destination="/root/.zfile-v4" # do not change
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8080 # change to port 5230
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
Create Persistent Disk
1 Create a new 1GB disk for your persistent data
- fly volumes create 51zfile --size 1
2 Related flyctl commands
PS C:/Users/john> flyctl --help
This is flyctl, the Fly.io command line interface.
Usage:
flyctl.exe [flags]
flyctl.exe [command]
Deploying apps & machines
apps Manage apps.
deploy Deploy Fly applications
launch Create and configure a new app from source code or a Docker image
machine Manage Fly Machines.
status Show app status
Configuration & scaling
certs Manage certificates
config Manage an app's configuration
image Manage app image
ips Manage IP addresses for apps
scale Scale app resources
secrets Manage application secrets with the set and unset commands.
volumes Manage Fly Volumes.
Monitoring & managing things
checks Manage health checks
console Run a console in a new or existing machine
dashboard Open web browser on Fly Web UI for this app
dig Make DNS requests against Fly.io's internal DNS server
incidents Show incidents
logs View app logs
ping Test connectivity with ICMP ping messages
proxy Proxies connections to a Fly Machine.
releases List app releases
services Show the application's services
sftp Get or put files from a remote VM.
ssh Use SSH to log into or run commands on Machines
wireguard Commands that manage WireGuard peer connections
Databases & extensions
consul Enable and manage Consul clusters
extensions Extensions are additional functionality that can be added to your Fly apps
litefs-cloud LiteFS Cloud management commands
mysql Provision and manage MySQL database clusters
postgres Manage Postgres clusters.
redis Launch and manage Redis databases managed by Upstash.com
storage Provision and manage Tigris object storage buckets
Access control
auth Manage authentication
orgs Commands for managing Fly organizations
tokens Manage Fly.io API tokens
Help & troubleshooting
docs View Fly documentation
doctor The DOCTOR command allows you to debug your Fly environment
platform Fly platform information
Additional Commands:
agent Commands that manage the Fly agent, a background process that manages flyctl wireguard connections
completion Generate the autocompletion script for the specified shell
help Help about any command
jobs Show jobs at Fly.io
settings Manage flyctl settings
synthetics Synthetic monitoring
version Show version information for the flyctl command
Flags:
-t, --access-token string Fly API Access Token
--debug Print additional logs and traces
-h, --help help for flyctl.exe
--verbose Verbose output
Use "flyctl.exe [command] --help" for more information about a command.
PS C:/Users/john>
3 Related flyctl volume commands
Manage Fly Volumes. Volumes are persistent storage for Fly Machines. Learn how how volumes work:
https://fly.io/docs/volumes/overview/.
Usage:
flyctl.exe volumes [command]
Aliases:
volumes, volume, vol
Available Commands:
create Create a new volume for an app.
destroy Destroy one or more volumes.
extend Extend a volume to the specified size.
fork Fork the specified volume.
list List the volumes associated with an app.
show Show the details of the specified volume.
snapshots Manage volume snapshots.
update Update a volume for an app.
Flags:
-h, --help help for volumes
Global Flags:
-t, --access-token string Fly API Access Token
--debug Print additional logs and traces
--verbose Verbose output
Use "flyctl.exe volumes [command] --help" for more information about a command.
PS C:/Users/john>
4 flyctl volume create 51zfile --size 1
PS C:/Users/john> flyctl volume create 51zfile --size 1
Warning! Every volume is pinned to a specific physical host. You should create two or more volumes per application to av? Do you still want to use the volumes feature? Yes
Some regions require a Launch plan or higher (bom).N) y
See https://fly.io/plans to set up a plan.
? Select region: Toronto, Canada (yyz)
ID: vol_remy7o667loxqel4
Name: 51zfile
App: 51zfile
Region: yyz
Zone: 520a
Size GB: 1
Encrypted: true
Created at: 22 Jan 25 16:22 UTC
Snapshot retention: 5
Scheduled snapshots: true
PS C:/Users/john>
PS C:/Users/john> flyctl volume list ID STATE NAME SIZE REGION ZONE ENCRYPTED ATTACHED VM CREATED AT vol_remy7o667loxqel4 created 51zfile 1GB yyz 520a true 2 minutes ago
Fly.io deploy
PS C:/Users/john> fly deploy ==> Verifying app config Validating C:/Users/john/fly.toml ✓ Configuration is valid --> Verified app config ==> Building image Searching for image 'zhaojun1998/zfile' remotely... image found: img_3mno4w2dy794k18q Watch your deployment at https://fly.io/apps/51zfile/monitoring This deployment will: * create 1 "app" machine No machines in group app, launching a new machine Finished launching new machines ------- ✔ Machine e82dd00f723748 [app] update finished: success ------- Checking DNS configuration for 51zfile.fly.dev Visit your newly deployed app at https://51zfile.fly.dev/ PS C:/Users/john>
Zeabur.com
Deploy through Zeabur platform;s template: https://zeabur.com/templates/441Y8R
services: - name: zfile icon: https://raw.githubusercontent.com/ikxin/zeabur/main/templates/zfile/icon.png template: PREBUILT_V2 spec: source: image: zhaojun1998/zfile ports: - id: web port: 8080 type: HTTP volumes: - id: db dir: /root/.zfile-v4/db - id: logs dir: /root/.zfile-v4/logs - id: file dir: /data/file domainKey: PUBLIC_DOMAIN
This project is deployed in a free trial region and will be deleted after 24 hours.
Please select other regions for deploying production projects
Render
https://dashboard.render.com/
Koyeb
https://www.koyeb.com/
Videos
References
- Zeabur template: https://zeabur.com/templates/441Y8R
共有 0 条评论