Add workflow
All checks were successful
/ build-container (push) Successful in 42s

a
This commit is contained in:
Marsn3 2025-02-27 12:56:16 +01:00
parent ea57995b75
commit deb3586f45
6 changed files with 2371 additions and 4 deletions

4
.dockerignore Normal file
View file

@ -0,0 +1,4 @@
node_modules
.devenv
.direnv
dist

View file

@ -0,0 +1,22 @@
on: [push]
jobs:
build-container:
runs-on: nix
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- name: Login to registry
uses: docker/login-action@v3
with:
registry: git.m3.fyi
username: ${{ vars.FORGEJO_USER }}
password: ${{ secrets.FORGEJO_TOKEN }}
- name: Setup Docker
uses: docker/setup-buildx-action@v3
- name: Build and push container
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: git.m3.fyi/metrik/kiku:${{gitea.sha}},git.m3.fyi/metrik/kiku:latest

24
Dockerfile Normal file
View file

@ -0,0 +1,24 @@
FROM node:23-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
FROM cgr.dev/chainguard/node
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
COPY --from=build /app/package.json /app/package.json
WORKDIR /app
CMD [ "dist/index.js"]

View file

@ -8,8 +8,9 @@
packages = [pkgs.git];
# https://devenv.sh/languages/
languages.typescript = {
enable = true;
};
languages.javascript.enable = true;
languages.javascript.pnpm.enable = true;
languages.typescript.enable = true;
dotenv.disableHint = true;
}

View file

@ -4,7 +4,8 @@
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsx watch src/index.ts"
"dev": "tsx watch src/index.ts",
"start": "node dist/index.js"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",

2315
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load diff