Skip to content

Commit

Permalink
Merge da4257b into 20441ec
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonn authored Jun 13, 2024
2 parents 20441ec + da4257b commit 96d3904
Show file tree
Hide file tree
Showing 51 changed files with 3,763 additions and 1,567 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.git
.gitignore
*.md
tests
examples
dist
59 changes: 59 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Docker Publish

on:
workflow_dispatch:
push:
branches:
- main
- develop
tags:
- release/*

jobs:
docker-build-push:
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v4

- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
context: git
images: ghcr.io/${{ github.repository }}
flavor: |
latest=auto
tags: |
type=ref,event=tag
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmm'}}
type=sha,enable=true,prefix=sha-,format=short
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
target: service
push: true
provenance: false
platforms: linux/amd64, linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM node:20-slim AS base

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN corepack use pnpm@latest

COPY . /app
WORKDIR /app

FROM base AS prod-deps
RUN npm pkg delete scripts.prepare
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile

FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build

FROM base AS service
COPY --from=prod-deps /app/node_modules /node_modules
COPY --from=build /app/packages /app/packages
COPY --from=build /app/apps/service /app/apps/service

WORKDIR /app/apps/service
RUN pnpm add @nestjs/cli -D

ENV NODE_ENV=production
EXPOSE 3000
CMD [ "pnpm", "start" ]
2 changes: 0 additions & 2 deletions apps/next/.env.example

This file was deleted.

36 changes: 0 additions & 36 deletions apps/next/.gitignore

This file was deleted.

36 changes: 0 additions & 36 deletions apps/next/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions apps/next/next.config.mjs

This file was deleted.

25 changes: 0 additions & 25 deletions apps/next/package.json

This file was deleted.

Binary file removed apps/next/src/app/favicon.ico
Binary file not shown.
19 changes: 0 additions & 19 deletions apps/next/src/app/layout.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions apps/next/src/app/page.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions apps/next/tsconfig.json

This file was deleted.

15 changes: 15 additions & 0 deletions apps/service/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# testnet for CKB and BTC Testnet and mainnet for CKB and BTC Mainnet, the default value is testnet
NETWORK=testnet

# CKB node url which should be matched with NETWORK
CKB_RPC_URL=https://testnet.ckb.dev

# The BTC assets api url which should be matched with NETWORK
BTC_SERVICE_URL=https://btc-assets-api.testnet.mibao.pro

# The BTC assets api token which should be matched with IS_MAINNET
# To get an access token, please refer to https://github.com/ckb-cell/rgbpp-sdk/tree/develop/packages/service#get-an-access-token
BTC_SERVICE_TOKEN=

# The BTC assets api origin which should be matched with IS_MAINNET
BTC_SERVICE_ORIGIN=https://btc-assets-api.testnet.mibao.pro
56 changes: 56 additions & 0 deletions apps/service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Loading

0 comments on commit 96d3904

Please sign in to comment.