Skip to content

Commit

Permalink
RA-60: Env variables fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mlinnik committed May 8, 2024
1 parent 2c85165 commit 11dfe8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions docker/.env.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
LOG=INFO
NETWORK=preprod
# mainnet, preprod, preview, sanchonet, devkit
PROTOCOL_MAGIC=1
NETWORK_MAGIC=1
# mainnet 764824073, preprod 1, preview 2, sanchonet 4, devkit 42
NETWORK_MAGIC=${PROTOCOL_MAGIC}

# Postgres variables
DB_NAME=rosetta-java
DB_NAME=rosetta-java-preprod
DB_USER=rosetta_db_admin
DB_SECRET=weakpwd#123_d
DB_HOST=localhost
Expand All @@ -19,8 +18,8 @@ CARDANO_NODE_PORT=3001
CARDANO_NODE_VERSION=8.9.0
CARDANO_NODE_SUBMIT_HOST=cardano-submit-api
NODE_SUBMIT_API_PORT=8090
CARDANO_NODE_SOCKET_PATH=./node-ipc
CARDANO_NODE_SOCKET=${CARDANO_NODE_SOCKET_PATH}/node.socket
CARDANO_NODE_SOCKET_PATH=/node-ipc
CARDANO_NODE_SOCKET=/node-ipc/node.socket
# Api env
API_SPRING_PROFILES_ACTIVE=dev
# staging, h2, test. Additional profiles: mempool (if mempool should be activated)
Expand Down
3 changes: 1 addition & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ RUN apt -y --no-install-recommends install openjdk-21-jdk
# Copy cardano node
COPY --from=cardano-builder /usr/local/lib /usr/local/lib
COPY --from=cardano-builder /root/.local/bin/cardano-* /usr/local/bin/
COPY --from=cardano-builder /root/src/cardano-node/cardano-submit-api/config/tx-submit-mainnet-config.yaml /root/cardano-submit-api
COPY --from=cardano-builder /root/src/cardano-node/cardano-submit-api/config/tx-submit-mainnet-config.yaml /root/cardano-submit-api/

ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
ENV PATH=/usr/local/lib/:$PATH
Expand All @@ -170,7 +170,6 @@ COPY ./config /config
RUN mkdir /current

RUN mkdir -p /data/db
RUN mkdir /ipc

# Copy jars
COPY --from=java-builder /root/app/api/target/*.jar /api/app.jar
Expand Down
3 changes: 2 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
echo "entrypoint - run node"
cp -r /config/${NETWORK}/* /current/
mkdir ${CARDANO_NODE_SOCKET_PATH}
cardano-node run --database-path /data/db --host-addr 0.0.0.0 --port ${CARDANO_NODE_PORT} --socket-path ${CARDANO_NODE_SOCKET} --topology /current/topology.json --config /current/config.json > /logs/node.log &

echo "entrypoint - run submit api"
cardano-submit-api --config /root/cardano-submit-api/tx-submit-mainnet-config.yaml --socket-path ${CARDANO_NODE_SOCKET} --port ${NODE_SUBMIT_API_PORT} --testnet-magic ${PROTOCOL_MAGIC} > /logs/submit-api.log &
cardano-submit-api --config /root/cardano-submit-api/tx-submit-mainnet-config.yaml --socket-path ${CARDANO_NODE_SOCKET} --port ${NODE_SUBMIT_API_PORT} --testnet-magic ${NETWORK_MAGIC} > /logs/submit-api.log &

echo "entrypoint - run postgres"
/etc/init.d/postgresql start
Expand Down

0 comments on commit 11dfe8a

Please sign in to comment.