Giter VIP home page Giter VIP logo

fastdfs-nginx's Introduction

Fastdfs nginx server

With some nginx modules in docker

Install

Conf

  • storage.conf
## can not use 127.0.0.1
tracker_server=host-ip:22122
  • mod_fastdfs.conf
tracker_server=127.0.0.1:22122
  • nginx.conf
## if need check token from redis
upstream redisbackend {
  server    redis-server-ip:port;
  keepalive 1024;
}
  • other conf files if you needed

Build

## you can use your image name to replace name 'fastdfs-nginx'
docker build -t fastdfs-nginx .

Network

## you can create your network for this server, like:
docker network create --driver bridge --subnet 192.168.1.0/20 network0

Run

## should use host network (test pass)
docker run -itd \
  --name fastdfs-nginx \
  --network=host \
  -v /etc/localtime:/etc/localtime:ro \
  -v /var/log/fdfs/:/data/fdfs/logs/ \
  -v /data/fdfs/data/:/data/fdfs/data/ \
  -v /var/log/nginx/:/var/log/nginx/ \
  fastdfs-nginx \
  sh -c "/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart && /usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart && /usr/sbin/nginx -g 'daemon off;'"

## if you want to use your network and use ip 192.168.16.6
## in this case, you should update some conf to make fdfs work
## like set tracker_server in storage.conf to 192.168.16.6
## the app which use fdfs-client-java to upload file should in the same network (not test yet)
docker run -itd \
  --name fastdfs-nginx \
  --network=network0 --ip=192.168.16.6 \
  -p 22122:22122 \
  -p 23000:23000 \
  -p 24001:24001 \
  -p 24002:24002 \
  -p 11411:11411 \
  -v /etc/localtime:/etc/localtime:ro \
  -v /var/log/fdfs/:/data/fdfs/logs/ \
  -v /data/fdfs/data/:/data/fdfs/data/ \
  -v /var/log/nginx/:/var/log/nginx/ \
  fastdfs-nginx \
  sh -c "/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart && /usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart && /usr/sbin/nginx -g 'daemon off;'"

API

## fetch file from server, if you need check token
http://ip:24001/group1/M00/00/00/xxxxxx?tk=zzz&&typ=yyy

## fetch file from server directly
http://ip:24002/group1/M00/00/00/xxxxxx.yyy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.