diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8da5f55..144809d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,9 +2,9 @@ name: DockerBuild on: push: - branches: [main] - tags: - - "v*" + # branches: [main] + # tags: + # - "v*" # pull_request: # branches: [main] diff --git a/dashboard/.env.example b/dashboard/.env.example index 4acac19..3ad4d10 100644 --- a/dashboard/.env.example +++ b/dashboard/.env.example @@ -1 +1 @@ -DUCKDB_PATH=lens-public-data/sample +DUCKDB_PATH=lens-public-data/v2_polygon.db diff --git a/dashboard/Dockerfile b/dashboard/Dockerfile index 24ff8c3..025b801 100644 --- a/dashboard/Dockerfile +++ b/dashboard/Dockerfile @@ -26,7 +26,6 @@ COPY . . # Learn more here: https://nextjs.org/telemetry # Uncomment the following line in case you want to disable telemetry during the build. # ENV NEXT_TELEMETRY_DISABLED 1 -ENV PARQUET_DIR_PATH lens-public-data/sample RUN yarn build diff --git a/dashboard/README.md b/dashboard/README.md index a30e7a3..a229d40 100644 --- a/dashboard/README.md +++ b/dashboard/README.md @@ -13,6 +13,12 @@ bun install bun dev ``` +## Build Docker Image + +```bash +docker build --build-arg DUCKDB_PATH=/path/to/v2_polygon.db -t lenscan . +``` + ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. diff --git a/dashboard/components/dau-stats.tsx b/dashboard/components/dau-stats.tsx index 20a3b20..d8663b3 100644 --- a/dashboard/components/dau-stats.tsx +++ b/dashboard/components/dau-stats.tsx @@ -4,7 +4,7 @@ import { Card, CardContent, CardHeader } from "@/components/ui/card" import { getDauGrowthPercentages, getNetworkUserStats, -} from "@/app/api/analystics/active-users/getDailyActiveUser" +} from "@/app/api/analystics/active-users/getActiveUserStats" export default async function DauStats() { const dateRange = "1M" diff --git a/dashboard/lib/duckdb.ts b/dashboard/lib/duckdb.ts index 8834b76..f817ab2 100644 --- a/dashboard/lib/duckdb.ts +++ b/dashboard/lib/duckdb.ts @@ -1,8 +1,9 @@ import { Database } from "duckdb-async" -const accessMode = 0 // 1 = read/write, 0 = read-only -const duckdb = await Database.create(process.env.DUCKDB_PATH, { - access_mode: "READ_ONLY", -}) +const readonly = 1 // 1 = readonly, 0 = readwrite +const duckdb = await Database.create( + process.env.DUCKDB_PATH as string, + readonly +) export { duckdb } diff --git a/dashboard/release.sh b/dashboard/release.sh new file mode 100644 index 0000000..c8985e3 --- /dev/null +++ b/dashboard/release.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Set environment variables +REGISTRY="ghcr.io" +IMAGE_NAME="daoleno/lenscan" +DUCKDB_PATH=lens-public-data/v2_polygon.db + +# Ask for the tag +echo "Please enter the tag for the Docker image:" +read TAG + +# Log in to the container registry +echo "Logging in to the container registry..." +echo "Please enter your GitHub Personal Access Token:" +read -s GITHUB_TOKEN # Read the GitHub Token securely +echo $GITHUB_TOKEN | docker login $REGISTRY -u daoleno --password-stdin + +# Build the Docker image, add --build-arg if needed +echo "Building the Docker image..." +docker build -t $REGISTRY/$IMAGE_NAME:$TAG ./dashboard # Ensure the correct build context is used + +# Push the Docker image to the registry +echo "Pushing the Docker image..." +docker push $REGISTRY/$IMAGE_NAME:$TAG + +# Log out from the container registry +echo "Logging out from the container registry..." +docker logout $REGISTRY + +echo "Docker image build and push completed."