forked from serverless-dns/serverless-dns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'serverless-dns:main' into main
- Loading branch information
Showing
35 changed files
with
768 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: 🔄 runc | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: "ghcr.io" | ||
IMAGE_NAME: ${{ github.repository }} | ||
GIT_REF: ${{ github.event.inputs.git-ref || github.ref }} | ||
|
||
# docs.github.com/en/actions/publishing-packages/publishing-docker-images | ||
jobs: | ||
nodejs: | ||
name: 🚀 Node on Alpine | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
|
||
steps: | ||
- name: 🚚 Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.GIT_REF }} | ||
fetch-depth: 0 | ||
|
||
- name: 🔐 Login | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: 🏷️ Metadata | ||
id: meta | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: 🛠 Build | ||
id: push | ||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | ||
with: | ||
context: . | ||
file: ./node.Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: 📕 Attest | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"process": "https://deno.land/[email protected]/node/process.ts", | ||
"@serverless-dns/dns-parser": "https://github.com/serverless-dns/dns-parser/raw/v2.1.2/index.js", | ||
"@serverless-dns/lfu-cache": "https://github.com/serverless-dns/lfu-cache/raw/v3.4.1/lfu.js", | ||
"@serverless-dns/trie/": "https://github.com/serverless-dns/trie/raw/v0.0.13/src/" | ||
"@serverless-dns/trie/": "https://github.com/serverless-dns/trie/raw/v0.0.13/src/", | ||
"@riaskov/mmap-io": "https://github.com/ARyaskov/mmap-io/raw/v1.4.3/src" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,34 @@ | ||
FROM node:20 as setup | ||
FROM node:22 as setup | ||
# git is required if any of the npm packages are git[hub] packages | ||
RUN apt-get update && apt-get install git -yq --no-install-suggests --no-install-recommends | ||
WORKDIR /node-dir | ||
WORKDIR /app | ||
COPY . . | ||
# get deps, build, bundle | ||
RUN npm i | ||
# webpack externalizes native modules (@riaskov/mmap-io) | ||
RUN npm run build:fly | ||
# or RUN npx webpack --config webpack.fly.cjs | ||
# download blocklists and bake them in the img | ||
RUN export BLOCKLIST_DOWNLOAD_ONLY=true && node ./dist/fly.mjs | ||
# or RUN export BLOCKLIST_DOWNLOAD_ONLY=true && node ./src/server-node.js | ||
|
||
# stage 2 | ||
FROM node:alpine AS runner | ||
# pin to node22 for native deps (@ariaskov/mmap-io) | ||
FROM node:22-alpine AS runner | ||
|
||
# env vals persist even at run-time: archive.is/QpXp2 | ||
# and overrides fly.toml env values | ||
ENV NODE_ENV production | ||
ENV NODE_OPTIONS="--max-old-space-size=320 --heapsnapshot-signal=SIGUSR2" | ||
ENV NODE_OPTIONS="--max-old-space-size=200 --heapsnapshot-signal=SIGUSR2" | ||
# get working dir in order | ||
WORKDIR /app | ||
COPY --from=setup /node-dir/dist ./ | ||
COPY --from=setup /node-dir/blocklists__ ./blocklists__ | ||
COPY --from=setup /node-dir/dbip__ ./dbip__ | ||
# external deps not bundled by webpack | ||
RUN npm i @riaskov/[email protected] | ||
|
||
COPY --from=setup /app/dist ./ | ||
COPY --from=setup /app/blocklists__ ./blocklists__ | ||
COPY --from=setup /app/dbip__ ./dbip__ | ||
|
||
# print files in work dir, must contain blocklists | ||
RUN ls -Fla | ||
# run with the default entrypoint (usually, bash or sh) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
e62deab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: