Skip to content

Commit

Permalink
remove submodule, update graphql, add explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
naviocean committed Apr 7, 2021
1 parent 3b35008 commit dd5c0c6
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 18 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "graphql/cardano-graphql"]
path = graphql/cardano-graphql
url = https://github.com/input-output-hk/cardano-graphql.git
[submodule "explorer/app"]
path = explorer/app
url = https://github.com/input-output-hk/cardano-explorer-app.git
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ git clone \
--single-branch \
--branch <VERSION> \
https://github.com/hawkingnetwork/cardano-node-docker.git \
&& cd cardano-node-docker \
&& git submodule update --init --recursive
&& cd cardano-node-docker
```

## Build and Run via Docker Compose
Expand All @@ -23,7 +22,10 @@ git clone \
bash build.sh
```

2. Run docker
2. Config Explorer
Change your server's IP in line 184 `- GRAPHQL_API_HOST=192.168.1.219`

3. Run docker

```console
docker-compose up -d && docker-compose logs -f
Expand Down
10 changes: 7 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ NODE_VERSION=1.25.1
MONITOR_VERSION=1.0.0
HASURA_VERSION=4.0.0
GRAPHQL_VERSION=4.0.0

EXPLORER_VERSION=1.5.0
#build node
docker build ./node -t naviocean/cardano-node:${NODE_VERSION}
docker build ./node -t naviocean/cardano-node:${NODE_VERSION} --build-arg RELEASE=${NODE_VERSION}
docker image tag naviocean/cardano-node:${NODE_VERSION} naviocean/cardano-node:latest

#build monitor
Expand All @@ -17,5 +17,9 @@ docker build ./hasura -t naviocean/cardano-graphql-hasura:${HASURA_VERSION}
docker image tag naviocean/cardano-graphql-hasura:${HASURA_VERSION} naviocean/cardano-graphql-hasura:latest

#build graphql
docker build ./graphql -t naviocean/cardano-graphql:${GRAPHQL_VERSION}
docker build ./graphql -t naviocean/cardano-graphql:${GRAPHQL_VERSION} --build-arg RELEASE=${GRAPHQL_VERSION}
docker image tag naviocean/cardano-graphql:${GRAPHQL_VERSION} naviocean/cardano-graphql:latest

#build explorer
docker build ./explorer -t naviocean/cardano-explorer:${EXPLORER_VERSION} --build-arg RELEASE=${EXPLORER_VERSION}
docker image tag naviocean/cardano-explorer:${EXPLORER_VERSION} naviocean/cardano-explorer:latest
26 changes: 21 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ services:
stop_grace_period: 10s
ports:
- 3001:3001
- 12798:12798
volumes:
- type: volume
source: node-ipc
Expand Down Expand Up @@ -56,8 +55,6 @@ services:

postgres:
image: postgres:13-alpine
ports:
- 5432:5432
secrets:
- postgres_db
- postgres_password
Expand Down Expand Up @@ -123,8 +120,6 @@ services:

hasura:
image: naviocean/cardano-graphql-hasura:latest
ports:
- 8080:8080
depends_on:
- postgres
networks: [cardano]
Expand Down Expand Up @@ -175,6 +170,27 @@ services:
max-size: "200k"
max-file: "10"

cardano-explorer:
image: naviocean/cardano-explorer:latest
depends_on:
- cardano-graphql
ports:
- 4000:4000
networks: [cardano]
restart: on-failure
environment:
- CARDANO_NETWORK=testnet
- GRAPHQL_API_PROTOCOL=http
- GRAPHQL_API_HOST=192.168.1.219
- GRAPHQL_API_PORT=3100
- GRAPHQL_API_PATH=graphql
- DEBUG=true
- PORT=4000
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
secrets:
postgres_db:
file: ./configs/secrets/postgres_db
Expand Down
49 changes: 49 additions & 0 deletions explorer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM debian:stable-slim
LABEL name="cardano-node-explorer"
LABEL maintainer="https://github.com/hawkingnetwork"

ARG NODEJS_MAJOR_VERSION=12
ARG RELEASE=1.5.0

ENV DEBIAN_FRONTEND=nonintercative

WORKDIR /

RUN apt-get update && apt-get install curl -y &&\
curl --proto '=https' --tlsv1.2 -sSf -L https://deb.nodesource.com/setup_${NODEJS_MAJOR_VERSION}.x | bash - &&\
apt-get install nodejs git -y

RUN curl --proto '=https' --tlsv1.2 -sSf -L https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - &&\
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list &&\
apt-get update && apt-get install gcc g++ make gnupg2 yarn -y

# Clone source code
RUN git clone https://github.com/input-output-hk/cardano-explorer-app.git /app
WORKDIR /app
RUN git fetch --all --recurse-submodules --tags
RUN git tag
RUN git checkout tags/${RELEASE}

# Creating non root user cardano
RUN useradd -m cardano

# # Add permissions
RUN chown -R cardano:cardano /app
RUN chmod g+s /app

# Image clean-up
RUN apt-get autoremove -y
RUN apt-get clean
RUN apt-get autoclean



COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chown cardano:cardano /entrypoint.sh
# Switch user
USER cardano:cardano

EXPOSE 4000

CMD ["/entrypoint.sh"]
1 change: 0 additions & 1 deletion explorer/app
Submodule app deleted from bfd86e
11 changes: 11 additions & 0 deletions explorer/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

echo "CARDANO_NETWORK=${CARDANO_NETWORK:-testnet}" > .env
echo "GRAPHQL_API_HOST=${GRAPHQL_API_HOST:-cardano-graphql}" >> .env
echo "GRAPHQL_API_PATH=${GRAPHQL_API_PATH:-graphql}" >> .env
echo "GRAPHQL_API_PORT=${GRAPHQL_API_PORT:-3100}" >> .env
echo "GRAPHQL_API_PROTOCOL=${GRAPHQL_API_PROTOCOL:-http}" >> .env

yarn --offline && yarn static:build

yarn static:serve -p ${PORT:-4000}

0 comments on commit dd5c0c6

Please sign in to comment.