Install ceramic and glaze (#38)

* Install ceramic and glaze

* Set ceramic host on start

* Fix Dockerfile

* Tab instead of spaces

* Mention CERAMIC_HOST variable in readme

* Update Dockerfile

Co-authored-by: folex <0xdxdy@gmail.com>

Co-authored-by: folex <0xdxdy@gmail.com>
This commit is contained in:
Anatoly Laskaris 2022-06-21 11:08:30 +03:00 committed by GitHub
parent 0d35ccb7f9
commit 0044fea6e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 2 deletions

View File

@ -2,6 +2,8 @@
### If needed, go to https://github.com/linuxserver/docker-ipfs to see how it's done. ### If needed, go to https://github.com/linuxserver/docker-ipfs to see how it's done.
ARG IPFS=v0.9.0 ARG IPFS=v0.9.0
ARG CERAMIC_VERSION=2.3.x
ARG GLAZED_VERSION=0.2.x
FROM ipfs/go-ipfs:${IPFS} as ipfs FROM ipfs/go-ipfs:${IPFS} as ipfs
@ -19,6 +21,8 @@ LABEL maintainer="fluencelabs"
# environment # environment
ENV IPFS_PATH=/config/ipfs ENV IPFS_PATH=/config/ipfs
ENV IPFS_LOGGING_FMT=nocolor ENV IPFS_LOGGING_FMT=nocolor
# https://github.com/ceramicnetwork/js-ceramic/issues/2245
ENV CERAMIC_ROOT_PATH=/.ceramic
ENV RUST_LOG="info,aquamarine=warn,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,cranelift_codegen=info,wasmer_wasi=info" ENV RUST_LOG="info,aquamarine=warn,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,cranelift_codegen=info,wasmer_wasi=info"
ENV RUST_BACKTRACE="1" ENV RUST_BACKTRACE="1"
## set /run_fluence as the CMD binary ## set /run_fluence as the CMD binary
@ -29,10 +33,15 @@ ENV FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR=/ip4/127.0.0.1/tcp/5001
ENV FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR=/ip4/127.0.0.1/tcp/5001 ENV FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR=/ip4/127.0.0.1/tcp/5001
ENV FLUENCE_ENV_AQUA_IPFS_EXTERNAL_SWARM_MULTIADDR=/ip4/127.0.0.1/tcp/4001 ENV FLUENCE_ENV_AQUA_IPFS_EXTERNAL_SWARM_MULTIADDR=/ip4/127.0.0.1/tcp/4001
# install nodejs 16.x
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor > /usr/share/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x focal main" > /etc/apt/sources.list.d/nodesource.list
RUN \ RUN \
echo "**** install packages ****" && \ echo "**** install packages ****" && \
apt-get update && \ apt-get update && \
apt-get install -y \ apt-get install -y --no-install-recommends \
nodejs \
jq \ jq \
less \ less \
logrotate \ logrotate \
@ -44,6 +53,12 @@ RUN \
/var/lib/apt/lists/* \ /var/lib/apt/lists/* \
/var/tmp/* /var/tmp/*
# install ceramic and glaze
RUN npm install --cache /cache --global \
@ceramicnetwork/cli@$CERAMIC_VERSION \
@glazed/cli@$GLAZED_VERSION \
&& rm -rf /cache
# download fluence & builtin services # download fluence & builtin services
COPY fluence/services.json /services.json COPY fluence/services.json /services.json
COPY fluence/download_builtins.sh /download_builtins.sh COPY fluence/download_builtins.sh /download_builtins.sh

View File

@ -1,15 +1,28 @@
# node-distro # node-distro
The distributive and packaging of the Fluence node. The distributive and packaging of the Fluence node.
Currently provides Network Dashboard as a side-car. Currently provides Network Dashboard as a side-car.
## Configuration
### Environmental variables
| variable | required | description |
| -------------- | -------- | ---------------------- |
| `CERAMIC_HOST` | | ceramic daemon address |
## How to run ## How to run
Copy `docker-compose.yml` locally and run Copy `docker-compose.yml` locally and run
```bash ```bash
docker-compose up -d docker-compose up -d
``` ```
That will run 2 containers: local Fluence node and Network Dashboard connected to it. That will run 2 containers: local Fluence node and Network Dashboard connected
to it.
## How to open dashboard ## How to open dashboard
Open [http://localhost:8080](http://localhost:8080) in your browser Open [http://localhost:8080](http://localhost:8080) in your browser

View File

@ -0,0 +1,6 @@
#!/usr/bin/with-contenv bash
if ! [[ -z CERAMIC_HOST ]]; then
echo "Setting ceramicHost to $CERAMIC_HOST"
/usr/bin/ceramic config set ceramicHost "$CERAMIC_HOST"
fi