anon 7 vuotta sitten
commit
5e1d5e7806
4 muutettua tiedostoa jossa 67 lisäystä ja 0 poistoa
  1. 42 0
      Dockerfile
  2. 4 0
      ipfs.supervisor.conf
  3. 16 0
      start_ipfs
  4. 5 0
      supervisor.conf

+ 42 - 0
Dockerfile

@@ -0,0 +1,42 @@
+FROM ubuntu:16.04
+
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN \
+  sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
+  apt-get update && \
+  apt-get -y upgrade && \
+  apt-get -y install locales && \
+  locale-gen en_US.UTF-8
+
+RUN apt-get install -y curl git unzip wget
+
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US.UTF-8
+ENV LC_ALL en_US.UTF-8
+ENV HOME /root
+
+RUN apt-get -y install supervisor && \
+  mkdir -p /var/log/supervisor && \
+  mkdir -p /etc/supervisor/conf.d
+
+ADD supervisor.conf /etc/supervisor.conf
+
+RUN apt-get clean
+
+ENV IPFS_PATH /data/ipfs
+RUN mkdir -p $IPFS_PATH \
+  && adduser --disabled-password --home=$IPFS_PATH ipfs \
+  && chown ipfs:ipfs $IPFS_PATH
+
+VOLUME $IPFS_PATH
+
+RUN mkdir /root/ipfs && \
+    curl 'https://vcs.bsch.ca/public/ipfs-binaries/raw/master/go-ipfs_v0.4.16_linux-amd64.tar.gz' | tar xzf - -C /root/ipfs && \
+    mv /root/ipfs/go-ipfs/ipfs /usr/local/bin/ipfs && \
+    rm -rf /root/ipfs
+
+ADD ipfs.supervisor.conf /etc/supervisor/conf.d/
+ADD start_ipfs /usr/local/bin/start_ipfs
+
+CMD ["supervisord", "-c", "/etc/supervisor.conf"]

+ 4 - 0
ipfs.supervisor.conf

@@ -0,0 +1,4 @@
+[program:ipfs]
+user=ipfs
+command=/usr/local/bin/start_ipfs
+redirect_stderr=true

+ 16 - 0
start_ipfs

@@ -0,0 +1,16 @@
+#!/bin/sh
+set -e
+
+export IPFS_PATH=/data/ipfs
+
+ipfs version
+
+if [ -e "$IPFS_PATH/config" ]; then
+  echo "Found IPFS fs-repo at $repo"
+else
+  ipfs init
+  ipfs config --json Experimental.FilestoreEnabled true
+  ipfs bootstrap rm --all
+fi
+
+exec ipfs daemon --enable-pubsub-experiment

+ 5 - 0
supervisor.conf

@@ -0,0 +1,5 @@
+[supervisord]
+nodaemon=true
+
+[include]
+files = /etc/supervisor/conf.d/*.conf