Prathamesh Musale
6b74477aff
Part of [Create a public laconicd testnet](https://www.notion.so/Create-a-public-laconicd-testnet-896a11bdd8094eff8f1b49c0be0ca3b8) Reviewed-on: cerc-io/testnet-laconicd-stack#2 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
36 lines
1.0 KiB
Bash
Executable File
36 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build cerc/webapp-base
|
|
|
|
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
|
|
# See: https://stackoverflow.com/a/246128/1701505
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
CERC_CONTAINER_BUILD_WORK_DIR=${CERC_CONTAINER_BUILD_WORK_DIR:-$SCRIPT_DIR}
|
|
CERC_CONTAINER_BUILD_DOCKERFILE=${CERC_CONTAINER_BUILD_DOCKERFILE:-$SCRIPT_DIR/Dockerfile}
|
|
CERC_CONTAINER_BUILD_TAG=${CERC_CONTAINER_BUILD_TAG:-cerc/webapp-base:local}
|
|
|
|
docker build -t $CERC_CONTAINER_BUILD_TAG ${build_command_args} -f $CERC_CONTAINER_BUILD_DOCKERFILE $CERC_CONTAINER_BUILD_WORK_DIR
|
|
rc=$?
|
|
|
|
if [ $rc -ne 0 ]; then
|
|
echo "BUILD FAILED" 1>&2
|
|
exit $rc
|
|
fi
|
|
|
|
if [ "$CERC_CONTAINER_BUILD_TAG" != "cerc/webapp-base:local" ]; then
|
|
cat <<EOF
|
|
|
|
#################################################################
|
|
|
|
Built host container for $CERC_CONTAINER_BUILD_WORK_DIR with tag:
|
|
|
|
$CERC_CONTAINER_BUILD_TAG
|
|
|
|
To test locally run:
|
|
|
|
laconic-so run-webapp --image $CERC_CONTAINER_BUILD_TAG --env-file /path/to/environment.env
|
|
|
|
EOF
|
|
fi
|