使用docker compose安裝FastDfs文件服務(wù)器的實(shí)例詳解
docker-compose.yml
version: '2'
services:
fastdfs-tracker:
hostname: fastdfs-tracker
container_name: fastdfs-tracker
image: season/fastdfs:1.2
network_mode: "host"
command: tracker
volumes:
- ./tracker_data:/fastdfs/tracker/data
fastdfs-storage:
hostname: fastdfs-storage
container_name: fastdfs-storage
image: season/fastdfs:1.2
network_mode: "host"
volumes:
- ./storage_data:/fastdfs/storage/data
- ./store_path:/fastdfs/store_path
environment:
- TRACKER_SERVER=xxx.xxx.xxx.xxx:22122
command: storage
depends_on:
- fastdfs-tracker
fastdfs-nginx:
hostname: fastdfs-nginx
container_name: fastdfs-nginx
image: season/fastdfs:1.2
network_mode: "host"
volumes:
- ./nginx.conf:/etc/nginx/conf/nginx.conf
- ./store_path:/fastdfs/store_path
environment:
- TRACKER_SERVER=xxx.xxx.xxx.xxx:22122
command: nginx
需要注意:
network_mode 必須是host, 原因是當(dāng)上傳文件時,tracker會把storage的IP和端口發(fā)給client,如果是bridge模式,則發(fā)送的是內(nèi)網(wǎng)IP,client無法訪問到。
image采用season/fastdfs:1.2 不要用lastest, 因?yàn)閘astest不包含nginx服務(wù),其他fasdfs鏡像均沒有season的精簡。
nginx.conf(用于提供http的方式下載文件)
listen 7003是ngingx服務(wù)訪問端口,可自行切換
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_age
到此這篇關(guān)于使用docker-compose安裝FastDfs文件服務(wù)器的文章就介紹到這了,更多相關(guān)docker-compose安裝FastDfs內(nèi)容請搜索本站以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持本站!
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。
關(guān)注官方微信