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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.github/
.git/
README.md
55 changes: 55 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
push:
branches:
- main
tags:
- v*

jobs:
build:
name: Build & Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{raw}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,format=long,prefix=

- name: Set up Docker
uses: docker/setup-docker-action@v4
with:
version: latest
daemon-config: |
{
"features": {
"containerd-snapshotter": true
}
}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM ubuntu:latest AS build


RUN apt update && apt install cmake git clang zlib1g zlib1g-dev libllvm18 llvm llvm-dev llvm-runtime liblld-dev liblld-18 libpolly-18-dev -y

RUN git clone https://github.com/c3lang/c3c && \
cd c3c && \
git checkout 855be9288121d0f7a67d277f7bbbbf57fbfa2597 && \
mkdir build && \
cd build && \
cmake .. && \
cmake --build . && \
chmod +x c3c && \
cp c3c /usr/local/bin/c3c && \
cp -r lib /usr/local/bin/lib



RUN apt install nodejs npm -y

WORKDIR /app

COPY package.json package.json
COPY package-lock.json package-lock.json
RUN npm install


COPY . .
RUN npm run build

FROM node:latest AS run

WORKDIR /app

COPY --from=build /lib/x86_64-linux-gnu /lib/x86_64-linux-gnu
COPY --from=build /app .

RUN npm i

COPY --from=build /app/build/server build/server

ENTRYPOINT [ "npm", "run", "serve" ]