Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): Helia Docker #1

Merged
merged 25 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d1462db
feat(helia): :sparkles: New HeliaFetch Impl
whizzzkid Sep 28, 2023
feb6819
feat: :sparkles: Serve helia fetch responses
whizzzkid Sep 28, 2023
6c76f6e
feat(helia): ✨ MimeTypes Work Correctly
whizzzkid Sep 28, 2023
7d9aca7
feat(helia): ✨ Adding GC route.
whizzzkid Sep 28, 2023
6f0353a
feat(helia): ✨ IPNS Routing + Refactor
whizzzkid Sep 29, 2023
b96bc79
docs(helia):
whizzzkid Sep 29, 2023
f0fa2bb
fix(helia): 🚚 Routes
whizzzkid Sep 29, 2023
408c4fb
feat(helia): ✨ Helia Fetch IPNS
whizzzkid Sep 29, 2023
42f8acf
fix(helia): ➕ Adding Aegir
whizzzkid Sep 29, 2023
dddcefe
feat: :sparkles: Adding dockerfile.
whizzzkid Oct 3, 2023
4a41969
fix: 🔧 Fix docker builds
whizzzkid Oct 4, 2023
1ab5ca0
fix(helia): lint
whizzzkid Oct 4, 2023
26f328f
feat(helia): 👷 Adding docker publish step.
whizzzkid Oct 4, 2023
1db8748
fix(helia): 🔧 Adding custom CMAKE flags
whizzzkid Oct 4, 2023
450fd5a
fix: 👷 Fixing CI + Readme
whizzzkid Oct 4, 2023
4ff18f5
fix: 🔧 flags
whizzzkid Oct 4, 2023
09c0d18
fix: 🔧 Docker File
whizzzkid Oct 4, 2023
8ce2220
feat(helia): ✨ Add version string.
whizzzkid Oct 4, 2023
1783c52
fix: Cache in-memory Helia Version Info
whizzzkid Oct 4, 2023
8b8ad21
Update package.json
whizzzkid Oct 4, 2023
16990d5
Update package.json
whizzzkid Oct 4, 2023
c2e48f4
fix: ✏️ Fixing PR comments.
whizzzkid Oct 4, 2023
f10b667
fix(helia): 🐛 finding rootFile.
whizzzkid Oct 4, 2023
530ea20
fix(helia): 🐛 redirection bug caused mapping to be wrong.
whizzzkid Oct 4, 2023
eabfe41
fix(helia): 🎨 Making this readable.
whizzzkid Oct 4, 2023
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
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