This boilerplate showcases the deployment of an application on the Akash Network with SSH capabilities. It features two services: the app and the bastion host. These services facilitate secure access to the application container.
Akash does not support private Docker repositories. Create a public repository on Docker Hub if you don't already have one.
Learn more about the Akash Network at the Akash Guidebook.
Create a .env file with the following variables:
ACCOUNT=<docker account>
APP_REPOSITORY=<docker repository>
APP_TAG=<docker image tag>
BASTION_HOST_REPOSITORY=<docker repository>
BASTION_HOST_TAG=<docker image tag>
SSH_USER=<ssh user>
SSH_PORT=<ssh port to be exposed>
SSH_PUBLIC_KEY=<ssh public key>
SUBNET=<custom subnet for docker network e.g., 172.30.0.0/16>
You can use the provided Makefile for easy execution of the following commands. Alternatively, you can run each command manually.
mkdir -p ssh
ssh-keygen -t rsa -b 4096 -C '' -f ./ssh/id_rsa -q -N ''
chmod 400 ./ssh/id_rsadocker-compose build --no-cachedocker-compose pushdocker-compose updocker-compose downdocker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container>eval `ssh-agent -s`
ssh-add ./ssh/id_rsa
ssh -A <ssh user>@<provider> -p <provider generated port>ssh root@<container name> -p <SSH_PORT>
ssh root@app -p 2022This command generates a new SDL file in the deploy folder.
make sdlThe following commands create SSH keys, build Docker images, push them to the Docker repository, and generate a new SDL file.
make ssh-key # Generates SSH keys and updates .env file
make build
make push
make sdl # Creates a new SDL file in the deploy folderUse this boilerplate to deploy your application securely on the Akash Network with SSH access.