项目作者: rongfengliang

项目描述 :
ipfs-clutser-docker-compose
高级语言:
项目地址: git://github.com/rongfengliang/ipfs-clutser-docker-compose.git


ipfs cluster docker-compose running demo

how to running

  1. docker-compose up -d

add files

  • mkdir some static web pages in export0 directory
  1. mkdir -p compose/export0/users
  2. cd compose/export0/users
  3. touch index.html
  4. touch index.css
  5. content like below
  6. index.html:
  7. <!DOCTYPE html>
  8. <html lang="en">
  9. <head>
  10. <meta charset="UTF-8">
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  12. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  13. <title>user info page</title>
  14. <link rel="stylesheet" href="index.css">
  15. </head>
  16. <body>
  17. userinfo from ipfs0
  18. </body>
  19. </html>
  20. index.css:
  21. body {
  22. font-size: 80px;
  23. text-align: center;
  24. }
  • add files to ipfs

inside any contain of ipfs

  1. docker-compose exec ipfs0 sh
  2. ipfs add -r /export/users
  3. some result:
  4. added QmQPZwCUtjjTnWiMuyS7un6T2WdHtxWfa5YyFqwwSp9UwF users/index.css
  5. added QmSj9817rjvUYLCWXSxgMT89Sfr8jdYWJevrPDU2rACpvf users/index.html
  6. added QmZEubFCffhFAfPro18PSt78M1mtR32wcC82y13so91zcN users
  • access website
  1. http://localhost:8080/ipfs/QmZEubFCffhFAfPro18PSt78M1mtR32wcC82y13so91zcN
  2. or:
  3. http://localhost:8180/ipfs/QmZEubFCffhFAfPro18PSt78M1mtR32wcC82y13so91zcN