Skip to content

Commit

Permalink
Docker: Run with daemon --upgrade by default.
Browse files Browse the repository at this point in the history
Plus add some warnings for users running the container randomly.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
  • Loading branch information
hsanjuan committed Apr 27, 2018
1 parent 695177a commit 2fa41e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ RUN mkdir -p $IPFS_CLUSTER_PATH && \
VOLUME $IPFS_CLUSTER_PATH
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"]

# Defaults for ipfs-cluster-service would go here
CMD []
# Defaults for ipfs-cluster-service go here
CMD ["daemon", "--upgrade"]
4 changes: 2 additions & 2 deletions Dockerfile-bundle
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ RUN mkdir -p $IPFS_CLUSTER_PATH && \
VOLUME $IPFS_CLUSTER_PATH
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/start-daemons.sh"]

# Defaults for ipfs-cluster-service would go here
CMD []
# Defaults for ipfs-cluster-service go here
CMD ["daemon", "--upgrade"]
5 changes: 5 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ ipfs-cluster-service --version
if [ -e "${IPFS_CLUSTER_PATH}/service.json" ]; then
echo "Found IPFS cluster configuration at ${IPFS_CLUSTER_PATH}"
else
echo "This container only runs ipfs-cluster-service. ipfs needs to be run separately!"
echo "Initializing default configuration"
ipfs-cluster-service init
if [ -n "$IPFS_API" ]; then
echo "Using \$IPFS_API as value for ipfs_connector.ipfshttp.node_multiaddress in configuration"
sed -i "s;/ip4/127\.0\.0\.1/tcp/5001;$IPFS_API;" "${IPFS_CLUSTER_PATH}/service.json"
fi

echo "Warning: By default, the API and Proxy endpoints will listen on 0.0.0.0!"
sed -i 's;127\.0\.0\.1/tcp/9094;0.0.0.0/tcp/9094;' "${IPFS_CLUSTER_PATH}/service.json"
sed -i 's;127\.0\.0\.1/tcp/9095;0.0.0.0/tcp/9095;' "${IPFS_CLUSTER_PATH}/service.json"
fi
Expand Down

0 comments on commit 2fa41e7

Please sign in to comment.