Skip to content

Commit

Permalink
feat(server): Helia Docker (#1)
Browse files Browse the repository at this point in the history
* feat(helia): ✨ New HeliaFetch Impl

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* feat: ✨ Serve helia fetch responses

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* feat(helia): ✨ MimeTypes Work Correctly

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* feat(helia): ✨ Adding GC route.

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* feat(helia): ✨ IPNS Routing + Refactor

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* docs(helia):

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix(helia): 🚚 Routes

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* feat(helia): ✨ Helia Fetch IPNS

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix(helia): ➕ Adding Aegir

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* feat: ✨ Adding dockerfile.

* fix: 🔧 Fix docker builds

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix(helia): lint

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* feat(helia): 👷 Adding docker publish step.

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix(helia): 🔧 Adding custom CMAKE flags

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix: 👷 Fixing CI + Readme

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix: 🔧 flags

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix: 🔧 Docker File

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* feat(helia): ✨ Add version string.

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix: Cache in-memory Helia Version Info

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* Update package.json

Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>

* Update package.json

Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>

* fix: ✏️ Fixing PR comments.

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix(helia): 🐛 finding rootFile.

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix(helia): 🐛 redirection bug caused mapping to be wrong.

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

* fix(helia): 🎨 Making this readable.

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>

---------

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>
  • Loading branch information
whizzzkid and SgtPooki authored Oct 4, 2023
1 parent 7c66805 commit 13dd94b
Show file tree
Hide file tree
Showing 13 changed files with 26,113 additions and 1 deletion.
131 changes: 131 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

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

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

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

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

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist
build

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
45 changes: 45 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish docker images

on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
push:
description: 'Push to registry'
required: false
default: 'false'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name == 'push' || github.event.inputs.push == 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ out
# Nuxt.js build / generate output
.nuxt
dist
build

# Gatsby files
.cache/
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:20-slim

RUN apt-get update
RUN apt-get install -y build-essential cmake git libssl-dev

WORKDIR /app

COPY . .
RUN npm install
RUN npm run build
EXPOSE 8080
CMD [ "npm", "start" ]
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
# helia-docker
# helia-docker

Docker images for Helia.

## Purpose

This container image hosts helia in a node container. It implements [HTTP IPFS-gateway API](https://docs.ipfs.tech/concepts/ipfs-gateway/#gateway-types) and responds to the incoming requests using helia to fetch the content from IPFS.

## Building

```sh
$ docker build . --tag helia
```

Pass the explicit platform when building on a Mac.

```sh
$ docker build . --tag helia --platform linux/arm64
```

## Running

```sh
$ docker run -it -p 8080:8080 helia
```

## Author

- [whizzzkid](https://github.com/whizzzkid)
Loading

0 comments on commit 13dd94b

Please sign in to comment.