This commit is contained in:
@@ -12,20 +12,20 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to Container Registry
|
- name: Login to Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REPO_HOST }}
|
registry: ${{ secrets.REPO_HOST }}
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.DEPLOY_TOKEN }}
|
password: ${{ secrets.DEPLOY_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
@@ -33,3 +33,6 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||||
|
provenance: false
|
||||||
|
cache-from: type=registry,ref=${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:buildcache
|
||||||
|
cache-to: type=registry,ref=${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:buildcache,mode=max
|
||||||
33
Dockerfile
33
Dockerfile
@@ -1,35 +1,28 @@
|
|||||||
FROM node:24-alpine AS base
|
FROM oven/bun:1.3.9-alpine AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
||||||
|
FROM base AS prod-deps
|
||||||
|
COPY package.json bun.lock ./
|
||||||
|
RUN --mount=type=cache,id=bun,target=/root/.bun/install/cache \
|
||||||
|
bun install --production --frozen-lockfile || bun install --production
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
WORKDIR /app
|
COPY package.json bun.lock ./
|
||||||
|
RUN --mount=type=cache,id=bun,target=/root/.bun/install/cache \
|
||||||
RUN apk add --no-cache python3 make g++ libc6-compat
|
bun install --frozen-lockfile || bun install
|
||||||
|
|
||||||
COPY package.json pnpm-lock.yaml ./
|
|
||||||
|
|
||||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
|
|
||||||
pnpm install --frozen-lockfile || pnpm install
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pnpm run build
|
RUN bun run build
|
||||||
|
|
||||||
RUN pnpm prune --prod
|
FROM base AS runtime
|
||||||
|
|
||||||
FROM node:24-alpine AS runtime
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apk add --no-cache libc6-compat vips
|
|
||||||
|
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
COPY --from=builder /app/drizzle ./drizzle
|
COPY --from=prod-deps /app/node_modules ./node_modules
|
||||||
COPY --from=builder /app/scripts ./scripts
|
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
|
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
ENV PORT=4321
|
ENV PORT=4321
|
||||||
EXPOSE 4321
|
EXPOSE 4321
|
||||||
|
|
||||||
CMD ["sh", "-c", "node ./scripts/migrate.js && node ./dist/server/entry.mjs"]
|
CMD ["bun", "run", "./dist/server/entry.mjs"]
|
||||||
|
|||||||
45
flake.nix
45
flake.nix
@@ -5,7 +5,8 @@
|
|||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
outputs =
|
||||||
|
{ nixpkgs }:
|
||||||
let
|
let
|
||||||
allSystems = [
|
allSystems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
@@ -14,25 +15,33 @@
|
|||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
];
|
];
|
||||||
|
|
||||||
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
|
forAllSystems =
|
||||||
pkgs = import nixpkgs { inherit system; };
|
f:
|
||||||
});
|
nixpkgs.lib.genAttrs allSystems (
|
||||||
|
system:
|
||||||
|
f {
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
}
|
||||||
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShells = forAllSystems ({ pkgs }: {
|
devShells = forAllSystems (
|
||||||
default = pkgs.mkShell {
|
{ pkgs }:
|
||||||
packages = with pkgs; [
|
{
|
||||||
nodejs_24
|
default = pkgs.mkShell {
|
||||||
nodePackages.pnpm
|
packages = with pkgs; [
|
||||||
sqlite
|
nodejs_24
|
||||||
];
|
nodePackages.pnpm
|
||||||
|
sqlite
|
||||||
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
echo "Chronus dev shell"
|
echo "Chronus dev shell"
|
||||||
echo "Node version: $(node --version)"
|
echo "Node version: $(node --version)"
|
||||||
echo "pnpm version: $(pnpm --version)"
|
echo "pnpm version: $(pnpm --version)"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
16
package.json
16
package.json
@@ -13,24 +13,24 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "0.9.6",
|
"@astrojs/check": "0.9.6",
|
||||||
"@astrojs/node": "10.0.0-beta.4",
|
"@astrojs/node": "9.5.4",
|
||||||
"@astrojs/vue": "6.0.0-beta.1",
|
"@astrojs/vue": "5.1.4",
|
||||||
"@ceereals/vue-pdf": "^0.2.1",
|
"@ceereals/vue-pdf": "^0.2.1",
|
||||||
"@libsql/client": "^0.17.0",
|
"@libsql/client": "^0.17.0",
|
||||||
"@simplewebauthn/browser": "^13.2.2",
|
"@simplewebauthn/browser": "^13.2.2",
|
||||||
"@simplewebauthn/server": "^13.2.2",
|
"@simplewebauthn/server": "^13.2.3",
|
||||||
"@tailwindcss/vite": "^4.1.18",
|
"@tailwindcss/vite": "^4.2.1",
|
||||||
"astro": "6.0.0-beta.11",
|
"astro": "5.18.0",
|
||||||
"bcryptjs": "^3.0.3",
|
"bcryptjs": "^3.0.3",
|
||||||
"chart.js": "^4.5.1",
|
"chart.js": "^4.5.1",
|
||||||
"daisyui": "^5.5.18",
|
"daisyui": "^5.5.19",
|
||||||
"dotenv": "^17.3.1",
|
"dotenv": "^17.3.1",
|
||||||
"drizzle-orm": "0.45.1",
|
"drizzle-orm": "0.45.1",
|
||||||
"jsonwebtoken": "^9.0.3",
|
"jsonwebtoken": "^9.0.3",
|
||||||
"nanoid": "^5.1.6",
|
"nanoid": "^5.1.6",
|
||||||
"tailwindcss": "^4.1.18",
|
"tailwindcss": "^4.2.1",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vue": "^3.5.28",
|
"vue": "^3.5.29",
|
||||||
"vue-chartjs": "^5.3.3"
|
"vue-chartjs": "^5.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
7566
pnpm-lock.yaml
generated
7566
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user