Prepare docker image
- We clone the code from pickle-finance
git clone https://github.com/pickle-finance/pickle-ui.git
-
Installation dependencies
yarn -
Run
yarn start -
Visit
http://localhost:3000/ -
Packaged application
yarn buildthe final generated file is in the
.nextdirectory -
Create Dockerfile
vi Dockerfilefill in the following
FROM nginx COPY .next /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] -
Generate docker image
docker build . -t sueinz/pickle-finance:latestoutput
Sending build context to Docker daemon 261.2MB Step 1/4 : FROM nginx ---> bc9a0695f571 Step 2/4 : COPY .next /usr/share/nginx/html ---> eb334c4e3d8d Step 3/4 : EXPOSE 80 ---> Running in 176054dedab9 Removing intermediate container 176054dedab9 ---> 9f614780d0da Step 4/4 : CMD ["nginx", "-g", "daemon off;"] ---> Running in 7e78e7cf5668 Removing intermediate container 7e78e7cf5668 ---> 97471fe12c3d Successfully built 97471fe12c3d Successfully tagged sueinz/pickle-finance:latest -
View docker image
docker images -
Run the container
run in the background on port 3000
docker run -d --name pickle-finance -p 3000:80 --restart=unless-stopped sueinz/pickle-finance:latestaccess via
http://localhost:3000/ -
Upload image
docker push sueinz/pickle-finance:latest
Akash deployment environment preparation (Edgenet testnet)
Install wallet
The environment used here is ubuntu18.04
-
Download akash wallet program
wget https://github.com/ovrclk/akash/releases/download/v0.9.0-rc13/akash_0.9.0-rc13_linux_arm64.zip -
Unzip
tar -xvf akash_0.9.0-rc13_linux_arm64.zip -
Rename directory
mv akash_0.9.0-rc13_linux_arm64 akash -
Configure environment variables
/work/akash/akashfor the path we just unzippededit
/etc/profile, add the following at the endexport PATH=$PATH:/work/akash/akashrun after
akash versionoutput version number
v0.9.0-rc13 -
Create wallet address
Here you need to prepare some variables in advance,
KEY_NAMEis a string set by yourself, the default is aliceexport KEY_NAME=alice export KEYRING_BACKEND=localenerate wallet address
akash --keyring-backend "$KEYRING_BACKEND" keys add "$KEY_NAME"output
- name: alice type: local address: akash1cz87pqkad72gggrv3t7y2x9z56h9gqghlnx3j3 pubkey: akashpub1addwnpepqtnydvj056gy64uuquldq5yx7mr8ncmn3ut59wwl9p83d8h2v4rtg5xa3vn mnemonic: "" threshold: 0 pubkeys: [] **Important** write this mnemonic phrase in a safe place. It is the only way to recover your account if you ever forget your password. town wolf margin parrot strong disease dance eyebrow inflict meadow crunch version tube elite interest movie uphold column shift fox excuse humble nest calladdress is the account address we generated
The last 24 words are very important. They are the mnemonic words of our wallet. We need to save them and restore them when importing them
Receive test coins
-
Set a few commonly used variables first
Set a few commonly used variables firstexport AKASH_NET="https://raw.githubusercontent.com/ovrclk/net/master/edgenet" export AKASH_CHAIN_ID="$(curl -s "$AKASH_NET/chain-id.txt")" exprot AKASH_NODE="$(curl -s "$AKASH_NET/rpc-nodes.txt" | shuf -n 1)" export ACCOUNT_ADDRESS=akash1cz87pqkad72gggrv3t7y2x9z56h9gqSet a few commonly used variables firstghlnx3j3AKASH_NET: the base URL of the network you want to connect to
AKASH_CHAIN_ID: the ID of the chain to be connected
AKASH_NODE: node RPC address
ACCOUNT_ADDRESS: the wallet address generated earlier
-
Run the command to view the faucet address for receiving test coins
curl "$AKASH_NET/faucet-url.txt"output
https://akash.vitwit.com/faucet -
Open this address in the browser and fill in the wallet address after passing the man-machine authentication. After waiting for a while, the account receives the test currency, and you can check the balance through the command
akash --node "$AKASH_NODE" query bank balances "$ACCOUNT_ADDRESS"output
balances: - amount: "100000000" denom: uakt pagination: next_key: null total: "0"The accuracy of akt is 6, so the balance should be 100000000 uakt = 100 akt
Deploy Pickle-Finance
-
Configure the
deploy.ymlfile according to the application deployment tutorialreate & edit
deploy.ymlfiletouch deploy.yml vi deploy.ymladd the following
--- version: "2.0" services: wordpress: image: sueinz/pickle-finance:latest expose: - port: 80 to: - global: true profiles: compute: wordpress: resources: cpu: units: 0.2 memory: size: 512Mi storage: size: 512Mi placement: westcoast: signedBy: anyOf: - "akash1vz375dkt0c60annyp6mkzeejfq0qpyevhseu05" pricing: wordpress: denom: uakt amount: 5000 deployment: wordpress: westcoast: profile: web count: 1 -
Deploy
akash tx deployment create deploy.yml --from $KEY_NAME --node $AKASH_NODE --chain-id $AKASH_CHAIN_ID -y -
View the status of just deployed
akash query market lease list --owner $ACCOUNT_ADDRESS --node $AKASH_NODE --state activeoutput
leases: - lease_id: dseq: "206109" gseq: 1 oseq: 1 owner: akash19uwxt0ln3p9fenpdwtsm5rlmqsekc3g9ym6xqz provider: akash15ql9ycjkkxhpc2nxtnf78qqjguwzz8gc4ue7wl price: amount: "249" denom: uakt state: active pagination: next_key: null total: "0"record several variables of the previous output for use
export PROVIDER=akash15ql9ycjkkxhpc2nxtnf78qqjguwzz8gc4ue7wl export DSEQ=206109 export OSEQ=1 export GSEQ=1 -
Upload
Manifestakash provider send-manifest deploy.yml --node $AKASH_NODE --dseq $DSEQ --oseq $OSEQ --gseq $GSEQ --owner $ACCOUNT_ADDRESS --provider $PROVIDER -
View the specific information of the deployment
akash provider lease-status --node $AKASH_NODE --dseq $DSEQ --oseq $OSEQ --gseq $GSEQ --provider $PROVIDER --owner $ACCOUNT_ADDRESSoutput
{ "services": { "web": { "name": "web", "available": 0, "total": 1, "uris": [ "bat1ddainpepb77to5pqr661ss.provider4.akashdev.net" ], "observed-generation": 0, "replicas": 0, "updated-replicas": 0, "ready-replicas": 0, "available-replicas": 0 } }, "forwarded-ports": {} } -
Access the deployed application
http://bat1ddainpepb77to5pqr661ss.provider4.akashdev.net/ -
Close deployment
akash tx deployment close --node $AKASH_NODE --chain-id $AKASH_CHAIN_ID --dseq $DSEQ --owner $ACCOUNT_ADDRESS --from $KEY_NAME -y
The deployment of the tutorial is now complete.