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 2e75466 commit a7d2ed1
Show file tree
Hide file tree
Showing 2 changed files with 8 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 .
5 changes: 5 additions & 0 deletions scripts/modify_cardano-db-sync_prometheus_port.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

PROMETHEUS_PORT=8081
# Workaround to avoid port conflict between PrometheusPort and server's one
jq '.PrometheusPort |= ${PROMETHEUS_PORT}' config.json > config.tmp && mv config.tmp config.json

0 comments on commit a7d2ed1

Please sign in to comment.