Pass environment variables in compose file
This commit is contained in:
parent
af525ab404
commit
b00dcb66c8
@ -3,11 +3,11 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: cerc/laconic-faucet:local
|
image: cerc/laconic-faucet:local
|
||||||
environment:
|
environment:
|
||||||
${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
${CERC_FAUCET_KEY}
|
CERC_FAUCET_KEY: ${CERC_FAUCET_KEY}
|
||||||
volumes:
|
|
||||||
- ../config/laconic-faucet/start-server.sh:/start-server.sh
|
|
||||||
ports:
|
|
||||||
- "3000"
|
|
||||||
entrypoint: "bash"
|
entrypoint: "bash"
|
||||||
command: "/start-server.sh"
|
command: "./start-faucet.sh"
|
||||||
|
volumes:
|
||||||
|
- ../config/laconic-faucet/start-faucet.sh:/app/start-faucet.sh
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
set -u
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
set -u
|
|
||||||
|
|
||||||
yarn install
|
toml_file="./environments/local.toml"
|
||||||
|
|
||||||
toml_file = "/app/environments/local.toml"
|
|
||||||
|
|
||||||
# Set faucet key from env
|
# Set faucet key from env
|
||||||
faucet_key = ${CERC_FAUCET_KEY}
|
faucet_key=${CERC_FAUCET_KEY}
|
||||||
|
echo "The faucet key is $faucet_key"
|
||||||
|
|
||||||
# Update the faucetKey in local.toml
|
# Update the faucetKey in local.toml
|
||||||
sed -i "s/faucetKey = \"\"/faucetKey = \"$faucet_key\"/" "$toml_file"
|
sed -i "s/faucetKey = \"\"/faucetKey = \"$faucet_key\"/" "$toml_file"
|
||||||
@ -19,3 +18,4 @@ echo "Updated faucetKey in local.toml"
|
|||||||
|
|
||||||
# Start node-js server
|
# Start node-js server
|
||||||
yarn start-faucet
|
yarn start-faucet
|
||||||
|
echo "Started faucet"
|
Loading…
Reference in New Issue
Block a user