-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
34 lines (25 loc) · 893 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# https://github.com/yeasy/docker-ipfs
#
# Dockerfile for IPFS (https://ipfs.io/)
# Data is stored under /root/.ipfs/
FROM golang:1.11
LABEL maintainer "Baohua Yang <yangbaohua@gmail.com>"
ENV DEBIAN_FRONTEND noninteractive
ENV API_PORT 5002
ENV GATEWAY_PORT 8080
ENV SWARM_PORT 4001
EXPOSE ${SWARM_PORT}
# This may introduce security risk to expose API_PORT public
EXPOSE ${API_PORT}
EXPOSE ${GATEWAY_PORT}
# Install ipfs using ipfs-update and initialize
RUN go get -u github.com/ipfs/ipfs-update \
&& ipfs-update install latest \
&& ipfs init
# config the api endpoint, may introduce security risk to expose API_PORT public
RUN ipfs config Addresses.API /ip4/0.0.0.0/tcp/${API_PORT}
# config the gateway endpoint
RUN ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/${GATEWAY_PORT}
# by default, run `ipfs daemon` to start as a running node
ENTRYPOINT ["ipfs"]
CMD ["daemon"]