Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Dockerfiles and cloudbuid.yaml #11

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/dist
**/node_modules
cloudbuild.yaml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
yarn.lock
build/
dist/
.env
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## octopus-relayer

### Environments

The needed environments:

```bash
PROJECTID=octopus-dev-309403
SUB_VFP="/subscriptions/test-appchain-versioned-finality-proof-sub"
SUB_MSG="/subscriptions/test-appchain-message-sub"
SUB_SIGNED_MSG="/subscriptions/test-appchain-signed-message-sub"
SUB_UNSIGNED_MSG="/subscriptions/test-appchain-unsigned-message-sub"
TOPIC_VFP="/topics/test-appchain-versioned-finality-proof"
TOPIC_MSG="/topics/test-appchain-message"
TOPIC_SIGNED_MSG="/topics/test-appchain-signed-message"
TOPIC_UNSIGNED_MSG="/topics/test-appchain-unsigned-message"
APPCHAIN_SETTINGS={ "barnacle-latest": { "appchainId": "barnacle-latest", "subqlEndpoint": "", "wsRpcEndpoint": "wss://gateway.testnet.octopus.network/barnacle-latest/ubmp83h7khynzohqzlumb3focllbh12e" }}
APPCHAIN_ID=barnacle-latest
NEAR_SETTINGS={ "nearEnv": "testnet", "nearNodeUrl": "https://near-testnet.infura.io/v3/dabe9e95376540b083ae09909ea7c576", "archivalNearNodeUrl": "https://archival-rpc.testnet.near.org/", "walletUrl": "https://wallet.testnet.near.org", "helperUrl": "https://helper.testnet.near.org" }
CONTRACTS={ "registryContract": "registry.test_oct.testnet", "daoContractId": "council-keeper.registry.test_oct.testnet", "octTokenContractId": "oct.beta_oct_relay.testnet" }
RELAYER_NEAR_ACCOUNT={ "id": "test-relayer.testnet", "privateKey": "" }
```
24 changes: 24 additions & 0 deletions appchain.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:16-slim

RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Create and change to the app directory.
WORKDIR /app

# Copy package.json & package-lock.json
COPY package*.json ./

# Install production dependencies.
RUN npm install --only=production

# Copy local code to the container image.
COPY . ./

# Compile TypeScript codes
RUN npm run build

# Run the appchain-pub on container startup.
CMD [ "npm", "run", "appchain-pub"]
11 changes: 11 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-f', 'appchain.Dockerfile', '-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/octopus/$REPO_NAME/appchain-pub', '.' ]
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-f', 'icp.Dockerfile', '-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/octopus/$REPO_NAME/icp-sub', '.' ]
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-f', 'near.Dockerfile', '-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/octopus/$REPO_NAME/near-sub', '.' ]
images:
- 'us-central1-docker.pkg.dev/$PROJECT_ID/octopus/$REPO_NAME/appchain-pub'
- 'us-central1-docker.pkg.dev/$PROJECT_ID/octopus/$REPO_NAME/icp-sub'
- 'us-central1-docker.pkg.dev/$PROJECT_ID/octopus/$REPO_NAME/near-pub'
24 changes: 24 additions & 0 deletions icp.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:16-slim

RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Create and change to the app directory.
WORKDIR /app

# Copy package.json & package-lock.json
COPY package*.json ./

# Install production dependencies.
RUN npm install --only=production

# Copy local code to the container image.
COPY . ./

# Compile TypeScript codes
RUN npm run build

# Run the icp-sub on container startup.
CMD [ "npm", "run", "icp-sub"]
24 changes: 24 additions & 0 deletions near.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:16-slim

RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Create and change to the app directory.
WORKDIR /app

# Copy package.json & package-lock.json
COPY package*.json ./

# Install production dependencies.
RUN npm install --only=production

# Copy local code to the container image.
COPY . ./

# Compile TypeScript codes
RUN npm run build

# Run the near-sub on container startup.
CMD [ "npm", "run", "near-sub"]
Loading