Skip to content
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
31 changes: 31 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Push Docker Image

on:
workflow_dispatch:
# on:
# push:
# tags:
# - 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Build Docker Image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ github.ref_name }} .

- name: Push Docker Image to GitHub Container Registry
run: |
docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Node.js
FROM node:20

# Work directory
WORKDIR /app

# Install pnpm
RUN npm install -g pnpm

# Copy package.json, pnpm-lock.yaml to workdir
COPY package.json pnpm-lock.yaml ./

# Install dependencies
RUN pnpm install

# Copy the project
COPY . .

# Build app
RUN pnpm run build

# Run app
CMD ["pnpm", "run", "start"]
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Clone the repository and run on the root folder:
pnpm i
pnpm dev
```

### Node.js Server

When running `nuxt build` with the Node server preset, the result will be an entry point that launches a ready-to-run Node server.
Expand Down Expand Up @@ -41,3 +40,57 @@ module.exports = {
Also, you can use different [presets](https://nuxt.com/docs/getting-started/deployment#hosting-providers). E.g. **Cloudflare Pages**: `cloudflare_pages`.

Note, some providers do not support server-side rendering.

---

### Docker Setup

You can also run the application in Docker.
Build the image and run the container:
```
docker build -t celenium-app
docker run -p 3000:3000 --env-file .env celenium-app
```
Make sure to create a ```.env``` file in the root directory or pass the required environment variables directly with ```-e```.

### Run with Docker Compose
Start with:
```
docker-compose up -d
```

By default:
- Builds the image from the local `Dockerfile`
- Runs the app on `127.0.0.1:3000`
- Automatically restarts the container on failure
- Uses `npm run start` as the startup command
- Limits logs (10 MB per file, max 5 files)

If you want to use a prebuilt image from **GitHub Container Registry**, specify a tag:
- `TAG=latest docker-compose up -d`

---

### Environment Variables

#### Required for App Startup
- **NUXT_PUBLIC_API_DEV** — indexer API (e.g. `https://api.localhost:9876/v1`).
- **NUXT_PUBLIC_WSS_DEV** — webSocket endpoint (e.g. `wss://api.localhost:9876/v1/ws`).
- **NUXT_PUBLIC_SELFHOSTED** — set to `true` when running in self-hosted mode.

#### Blobstream Configuration
- **NUXT_PUBLIC_BLOBSTREAM_MAINNET** — API for blobstream data.

#### Faucet Configuration
- **NUXT_PUBLIC_FAUCET_ADDRESS** — faucet address.
- **NUXT_PUBLIC_FAUCET_MOCHA** — faucet API for the Mocha network.
- **NUXT_PUBLIC_FAUCET_ARABICA** — faucet API for the Arabica network.
- **NUXT_PUBLIC_FAUCET_MAMMOTH** — faucet API for the Mammoth network.

#### External Services Configuration
- **NUXT_PUBLIC_BLOCKSCOUT** — used to check whether a batch exists in Blockscout. If found, a dedicated button will appear on the blob form/page.
- **NUXT_PUBLIC_NODE_STATS** — provides statistics about node types, versions, and geographic distribution across the Celestia ecosystem.
- **NUXT_PUBLIC_QUOTE** — provides price data. It is used to display the current TIA price in the header and to convert all values from TIA to USD.
- **NUXT_PUBLIC_ROLLUP_RANKING** — fetches rollup ranking data displayed on the rollup leaderboard, individual rollup pages, and a dedicated rollup ranking page. The ranking page also includes detailed calculations, as well as repository and commit statistics.
- **NUXT_PUBLIC_GITHUB** — required for retrieving repository statistics on a rollup ranking page.
- **NUXT_PUBLIC_TVL** — provides TVL (Total Value Locked) statistics for rollups and TVS (Total Value Secured) for the Celestia network. These values are displayed in the header, on the statistics page, and on individual rollup pages.
8 changes: 2 additions & 6 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ import { useSettingsStore } from "@/store/settings.store"
import { useEnumStore } from "@/store/enums.store"
import { useLegalStore } from "@/store/legal.store"
import { useNotificationsStore } from "@/store/notifications.store"
import { useActivityStore } from "@/store/activity.store"
const nodeStore = useNodeStore()
const appStore = useAppStore()
const bookmarksStore = useBookmarksStore()
const settingsStore = useSettingsStore()
const enumStore = useEnumStore()
const legalStore = useLegalStore()
const notificationsStore = useNotificationsStore()
const activityStore = useActivityStore()

bookmarksStore.$subscribe((mutation, state) => {
localStorage.setItem("bookmarks", JSON.stringify(state.bookmarks))
Expand All @@ -43,9 +41,6 @@ settingsStore.$subscribe((mutation, state) => {
legalStore.$subscribe((mutation, state) => {
localStorage.setItem("legal", JSON.stringify(state.legal))
})
activityStore.$subscribe((mutation, state) => {
localStorage.setItem("rollups_ranking", JSON.stringify(state.rollups_ranking))
})

appStore.initConstants()

Expand Down Expand Up @@ -98,8 +93,9 @@ onMounted(async () => {
}

settingsStore.init()
activityStore.init()

appStore.initGlobalUpdates()

const runtimeConfig = useRuntimeConfig()
amp.init(runtimeConfig.public.AMP)

Expand Down
Loading