Update docker build and compose file for console

This commit is contained in:
Prathamesh Musale 2024-06-20 10:52:38 +05:30
parent 1e014e6b2e
commit 8ee7040298
4 changed files with 37 additions and 8 deletions

View File

@ -2,6 +2,7 @@ services:
cli:
image: cerc/laconic2-registry-cli:local
environment:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_LACONICD_RPC_ENDPOINT: ${CERC_LACONICD_RPC_ENDPOINT:-http://laconicd:26657}
CERC_LACONICD_GQL_ENDPOINT: ${CERC_LACONICD_GQL_ENDPOINT:-http://laconicd:9473/api}
CERC_CHAIN_ID: ${CERC_CHAIN_ID:-laconic_9000-1}
@ -14,12 +15,13 @@ services:
laconic-console:
restart: unless-stopped
image: cerc/laconic-console-host:local
image: cerc/laconic2-console-host:local
environment:
- CERC_WEBAPP_FILES_DIR=${CERC_WEBAPP_FILES_DIR:-/usr/local/share/.config/yarn/global/node_modules/@cerc-io/console-app/dist/production}
- LACONIC_HOSTED_ENDPOINT=${LACONIC_HOSTED_ENDPOINT:-http://localhost:9473}
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_WEBAPP_FILES_DIR: ${CERC_WEBAPP_FILES_DIR:-/usr/local/share/.config/yarn/global/node_modules/@cerc-io/console-app/dist/production}
LACONIC_HOSTED_ENDPOINT: ${LACONIC_HOSTED_ENDPOINT:-http://localhost:9473}
volumes:
- ../config/laconic-console/console/config.yml:/config.yml
- ../config/laconic-console/console/config.yml:/config/config.yml
ports:
- "80"

View File

@ -2,6 +2,9 @@ FROM cerc/webapp-base:local
# Configure the cerc-io npm registry
RUN npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/
RUN npm config set @lirewine:registry https://git.vdb.to/api/packages/cerc-io/npm/
WORKDIR /app
COPY . .
@ -9,4 +12,5 @@ RUN echo "Installing dependencies" && yarn
RUN LACONIC_HOSTED_CONFIG_FILE=config-hosted.yml yarn dist
RUN npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/
RUN yarn global add file:$PWD

View File

@ -1,9 +1,10 @@
#!/usr/bin/env bash
# Build cerc/laconic-registry-cli
# Build cerc/laconic2-console-host
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 )
docker build -t cerc/laconic-console-host:local ${build_command_args} -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/laconic-console
docker build -t cerc/laconic2-console-host:local ${build_command_args} -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/laconic-console

View File

@ -35,7 +35,17 @@ Instructions for running laconic registry CLI and console
* Create a spec file for the deployment:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-spec.yml
laconic-so --stack /home/prathamesh/deepstack/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-spec.yml
```
* Edit `network` in the spec file to map container ports to host ports as required:
```bash
...
network:
ports:
laconic-console:
- '8080:80'
```
* Create a deployment from the spec file:
@ -49,6 +59,18 @@ Instructions for running laconic registry CLI and console
* Inside the deployment directory, open `config.env` file and set following env variables:
```bash
# TODO
# All optional
CERC_LACONICD_RPC_ENDPOINT=
CERC_LACONICD_GQL_ENDPOINT=
CERC_CHAIN_ID=
CERC_LOGLEVEL=
LACONIC_HOSTED_ENDPOINT=
```
## Start the deployment
```bash
laconic-so deployment --dir laconic-console-deployment start
```