Skip to content

Commit

Permalink
chore: add script to modify prometheus metrics port
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Cruz committed Jun 28, 2022
1 parent 22f075a commit f502aba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,12 @@ COPY --from=rosetta-server-builder /app/dist /cardano-rosetta-server/dist
COPY --from=rosetta-server-production-deps /app/node_modules /cardano-rosetta-server/node_modules
COPY ecosystem.config.js .
COPY postgresql.conf /etc/postgresql/12/main/postgresql.conf
COPY scripts/start_cardano-db-sync.sh scripts/maybe_download_cardano-db-sync_snapshot.sh /scripts/
COPY scripts/start_cardano-db-sync.sh scripts/maybe_download_cardano-db-sync_snapshot.sh scripts/modify_cardano-db-sync_prometheus_port.sh /scripts/
COPY config/network/${NETWORK} /config/
ENV PGPASSFILE=/config/cardano-db-sync/pgpass
RUN echo "/var/run/postgresql:5432:cexplorer:*:*" > $PGPASSFILE &&\
chmod 600 $PGPASSFILE && chown postgres:postgres $PGPASSFILE
RUN mkdir /snapshot &&\
./scripts/maybe_download_cardano-db-sync_snapshot.sh $SNAPSHOT_URL /snapshot
./scripts/maybe_download_cardano-db-sync_snapshot.sh $SNAPSHOT_URL /snapshot &&\
./scripts/modify_cardano-db-sync_prometheus_port.sh
COPY scripts/entrypoint.sh .
8 changes: 8 additions & 0 deletions scripts/modify_cardano-db-sync_prometheus_port.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

PROMETHEUS_PORT=8081
CONFIG_PATH=/home/atix/workspace/cardano-rosetta/config/network/testnet/cardano-db-sync/config.json

# Workaround to avoid port conflict between PrometheusPort and server's one
echo ${PROMETHEUS_PORT}
jq --arg PROMETHEUS_PORT ${PROMETHEUS_PORT} '.PrometheusPort |= ($PROMETHEUS_PORT | tonumber)' ${CONFIG_PATH} > config.tmp && mv config.tmp ${CONFIG_PATH}

0 comments on commit f502aba

Please sign in to comment.