From 3bf12c7ea6fb1a1e243b2d0d7471ea3819933ecc Mon Sep 17 00:00:00 2001 From: Graham Taylor Date: Wed, 11 May 2016 10:26:23 +0100 Subject: [PATCH] Initial commit of ipfs support --- files/ipfs-config | 10 ++++++++++ ipfs-with-webui/Dockerfile | 17 +++++++++++++++++ ipfs-with-webui/start.sh | 9 +++++++++ 3 files changed, 36 insertions(+) create mode 100644 files/ipfs-config create mode 100644 ipfs-with-webui/Dockerfile create mode 100644 ipfs-with-webui/start.sh diff --git a/files/ipfs-config b/files/ipfs-config new file mode 100644 index 0000000..e719d1d --- /dev/null +++ b/files/ipfs-config @@ -0,0 +1,10 @@ +"Addresses": { + "Swarm": [ + "/ip4/0.0.0.0/tcp/4001" + ], + "API": "/ip4/127.0.0.1/tcp/5001", + "Gateway": "/ip4/127.0.0.1/tcp/8080", + "Bootstrap": [ + "" + ] +} diff --git a/ipfs-with-webui/Dockerfile b/ipfs-with-webui/Dockerfile new file mode 100644 index 0000000..4b4409d --- /dev/null +++ b/ipfs-with-webui/Dockerfile @@ -0,0 +1,17 @@ +FROM ipfs/go-ipfs +#FROM alpine:3.3 + +EXPOSE 3000 + +RUN apk add --update git nodejs + +RUN cd /root &&\ + git clone https://github.com/ipfs/webui &&\ + cd webui &&\ + # Remove all build-time dependencies + apk del --purge git + +ADD start.sh /root/start.sh +RUN chmod +x /root/start.sh + +ENTRYPOINT /root/start.sh diff --git a/ipfs-with-webui/start.sh b/ipfs-with-webui/start.sh new file mode 100644 index 0000000..20e8bde --- /dev/null +++ b/ipfs-with-webui/start.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +cd /root/webui + +# ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://localhost:3000"]' +# ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]' +# ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"] +/usr/local/bin/start_ipfs $@