This guide will walk you through setting up a Docker image for the Changeblock backend.
Prepare the following configuration files:
config.json
.env
root.key
Finally, obtain a Cachix authentication token and use it to build the Docker image:
docker build --build-arg CACHIX_AUTHTOKEN=<AUTHTOKEN> -t elabs-backend .
Try running it
docker run --expose 8081 -p 8081:8081 elabs-backend
That's it! You have now successfully set up the Changeblock backend using Docker.
On AWS, we have a private registry repository called emurgo-labs-changeblock
. We will push the image to this repository.
We must install the AWS Command Line Interface to interact with our AWS account. https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
Ccopy the "Access Key ID" and the key itself from AWS and type:
aws configure
aws ecr get-login-password --region us-east-1 | \
docker login --username AWS --password-stdin 724240871965.dkr.ecr.us-east-1.amazonaws.com
docker tag <DOCKER_IMAGE> 724240871965.dkr.ecr.us-east-1.amazonaws.com/emurgo-labs-changeblock:testnet-latest
docker push 724240871965.dkr.ecr.us-east-1.amazonaws.com/emurgo-labs-changeblock:testnet-latest
Use mainnet-latest
for the mainnet image.
After you update the Docker image, you can deploy it to the environment.
cd remote-testnet
eb deploy
For mainnet
cd remote-mainnet
eb deploy