build arm image
This commit is contained in:
parent
b0e2e8b16c
commit
4b4e773686
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -0,0 +1 @@
|
|||||||
|
packages/reservation-platform/docker/myp-rp_latest.tar.xz filter=lfs diff=lfs merge=lfs -text
|
@ -1,4 +1,4 @@
|
|||||||
FROM node:20-bookworm
|
FROM node:20-bookworm-slim
|
||||||
|
|
||||||
# Create application directory
|
# Create application directory
|
||||||
RUN mkdir -p /usr/src/app
|
RUN mkdir -p /usr/src/app
|
||||||
@ -14,7 +14,11 @@ COPY package.json /usr/src/app
|
|||||||
COPY pnpm-lock.yaml /usr/src/app
|
COPY pnpm-lock.yaml /usr/src/app
|
||||||
|
|
||||||
# Install build tools
|
# Install build tools
|
||||||
RUN apt-get update && apt-get install -y build-essential
|
#RUN apt-get update && apt-get install -y \
|
||||||
|
# libsqlite3-dev \
|
||||||
|
# build-essential \
|
||||||
|
# && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
# Install pnpm
|
# Install pnpm
|
||||||
RUN corepack enable pnpm
|
RUN corepack enable pnpm
|
||||||
|
@ -4,14 +4,38 @@
|
|||||||
IMAGE_NAME="myp-rp"
|
IMAGE_NAME="myp-rp"
|
||||||
IMAGE_TAG="latest"
|
IMAGE_TAG="latest"
|
||||||
|
|
||||||
# Build the Docker image from Containerfile
|
# Create a new builder instance with a sensible name
|
||||||
echo "Building Docker image from Containerfile..."
|
BUILDER_NAME="myp-rp-arm64-builder"
|
||||||
docker build -t ${IMAGE_NAME}:${IMAGE_TAG} -f $PWD/Containerfile $PWD
|
echo "Creating a new builder instance named $BUILDER_NAME..."
|
||||||
|
docker buildx create --name $BUILDER_NAME --use
|
||||||
|
|
||||||
|
# Build the Docker image from Containerfile for arm64
|
||||||
|
echo "Building Docker image from Containerfile for arm64..."
|
||||||
|
docker buildx build --platform linux/arm64 -t ${IMAGE_NAME}:${IMAGE_TAG} -f $PWD/Containerfile $PWD --output type=docker,dest=docker/${IMAGE_NAME}_${IMAGE_TAG}.tar
|
||||||
|
|
||||||
# Check if the build was successful
|
# Check if the build was successful
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error occurred while building the Docker image"
|
echo "Error occurred while building the Docker image"
|
||||||
|
docker buildx rm $BUILDER_NAME
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Docker image built successfully"
|
echo "Docker image built successfully"
|
||||||
|
|
||||||
|
# Compress the tar file using xz
|
||||||
|
echo "Compressing the image to docker/${IMAGE_NAME}_${IMAGE_TAG}.tar.xz..."
|
||||||
|
xz -z docker/${IMAGE_NAME}_${IMAGE_TAG}.tar
|
||||||
|
|
||||||
|
# Check if the compression was successful
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error occurred while compressing the Docker image"
|
||||||
|
docker buildx rm $BUILDER_NAME
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Docker image compressed successfully as docker/${IMAGE_NAME}_${IMAGE_TAG}.tar.xz"
|
||||||
|
|
||||||
|
# Remove the builder instance
|
||||||
|
docker buildx rm $BUILDER_NAME
|
||||||
|
|
||||||
|
echo "Build process completed"
|
||||||
|
BIN
packages/reservation-platform/docker/myp-rp_latest.tar.xz
(Stored with Git LFS)
Normal file
BIN
packages/reservation-platform/docker/myp-rp_latest.tar.xz
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -5,8 +5,8 @@ export default defineConfig({
|
|||||||
dialect: "sqlite",
|
dialect: "sqlite",
|
||||||
schema: "./src/server/db/schema.ts",
|
schema: "./src/server/db/schema.ts",
|
||||||
out: "./drizzle",
|
out: "./drizzle",
|
||||||
driver: "better-sqlite",
|
driver: "libsql",
|
||||||
dbCredentials: {
|
dbCredentials: {
|
||||||
url: "db/sqlite.db",
|
url: "file:./db/sqlite.db",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -16,58 +16,57 @@
|
|||||||
"db:reset": "pnpm db:clean && pnpm db"
|
"db:reset": "pnpm db:clean && pnpm db"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@headlessui/react": "^2.0.3",
|
"@headlessui/react": "^2.1.9",
|
||||||
"@headlessui/tailwindcss": "^0.2.0",
|
"@headlessui/tailwindcss": "^0.2.1",
|
||||||
"@hookform/resolvers": "^3.3.4",
|
"@hookform/resolvers": "^3.9.0",
|
||||||
"@lucia-auth/adapter-drizzle": "^1.0.7",
|
"@libsql/client": "^0.14.0",
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@lucia-auth/adapter-drizzle": "^1.1.0",
|
||||||
"@radix-ui/react-avatar": "^1.0.4",
|
"@radix-ui/react-alert-dialog": "^1.1.2",
|
||||||
"@radix-ui/react-dialog": "^1.0.5",
|
"@radix-ui/react-avatar": "^1.1.1",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
"@radix-ui/react-dialog": "^1.1.2",
|
||||||
"@radix-ui/react-hover-card": "^1.0.7",
|
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
||||||
|
"@radix-ui/react-hover-card": "^1.1.2",
|
||||||
"@radix-ui/react-icons": "^1.3.0",
|
"@radix-ui/react-icons": "^1.3.0",
|
||||||
"@radix-ui/react-label": "^2.0.2",
|
"@radix-ui/react-label": "^2.1.0",
|
||||||
"@radix-ui/react-scroll-area": "^1.0.5",
|
"@radix-ui/react-scroll-area": "^1.2.0",
|
||||||
"@radix-ui/react-select": "^2.0.0",
|
"@radix-ui/react-select": "^2.1.2",
|
||||||
"@radix-ui/react-slot": "^1.0.2",
|
"@radix-ui/react-slot": "^1.1.0",
|
||||||
"@radix-ui/react-tabs": "^1.0.4",
|
"@radix-ui/react-tabs": "^1.1.1",
|
||||||
"@radix-ui/react-toast": "^1.1.5",
|
"@radix-ui/react-toast": "^1.2.2",
|
||||||
"@remixicon/react": "^4.2.0",
|
"@remixicon/react": "^4.2.0",
|
||||||
"@tanstack/react-table": "^8.16.0",
|
"@tanstack/react-table": "^8.20.5",
|
||||||
"@tremor/react": "^3.16.2",
|
"@tremor/react": "^3.18.3",
|
||||||
"arctic": "^1.8.1",
|
"arctic": "^1.9.2",
|
||||||
"better-sqlite3": "^9.6.0",
|
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"drizzle-orm": "^0.30.10",
|
"drizzle-orm": "^0.30.10",
|
||||||
"lucia": "^3.2.0",
|
"lucia": "^3.2.1",
|
||||||
"lucide-react": "^0.378.0",
|
"lucide-react": "^0.378.0",
|
||||||
"next": "14.2.3",
|
"next": "14.2.3",
|
||||||
"next-themes": "^0.3.0",
|
"next-themes": "^0.3.0",
|
||||||
"oslo": "^1.2.0",
|
"oslo": "^1.2.1",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-hook-form": "^7.51.4",
|
"react-hook-form": "^7.53.0",
|
||||||
"react-if": "^4.1.5",
|
"react-if": "^4.1.5",
|
||||||
"react-timer-hook": "^3.0.7",
|
"react-timer-hook": "^3.0.7",
|
||||||
"regression": "^2.0.1",
|
"regression": "^2.0.1",
|
||||||
"sonner": "^1.4.41",
|
"sonner": "^1.5.0",
|
||||||
"swr": "^2.2.5",
|
"swr": "^2.2.5",
|
||||||
"tailwind-merge": "^2.3.0",
|
"tailwind-merge": "^2.5.3",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"use-debounce": "^10.0.0",
|
"use-debounce": "^10.0.3",
|
||||||
"zod": "^3.23.8"
|
"zod": "^3.23.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^1.7.3",
|
"@biomejs/biome": "^1.9.3",
|
||||||
"@tailwindcss/forms": "^0.5.7",
|
"@tailwindcss/forms": "^0.5.9",
|
||||||
"@types/better-sqlite3": "^7.6.10",
|
"@types/node": "^20.16.11",
|
||||||
"@types/node": "^20.12.11",
|
"@types/react": "^18.3.11",
|
||||||
"@types/react": "^18.3.1",
|
|
||||||
"@types/react-dom": "^18.3.0",
|
"@types/react-dom": "^18.3.0",
|
||||||
"drizzle-kit": "^0.21.1",
|
"drizzle-kit": "^0.21.4",
|
||||||
"postcss": "^8.4.38",
|
"postcss": "^8.4.47",
|
||||||
"tailwindcss": "^3.4.3",
|
"tailwindcss": "^3.4.13",
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.6.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1688
packages/reservation-platform/pnpm-lock.yaml
generated
1688
packages/reservation-platform/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -6,13 +6,14 @@ import { Lucia, type RegisteredDatabaseUserAttributes, type Session } from "luci
|
|||||||
import { cookies } from "next/headers";
|
import { cookies } from "next/headers";
|
||||||
import { cache } from "react";
|
import { cache } from "react";
|
||||||
|
|
||||||
|
//@ts-ignore
|
||||||
const adapter = new DrizzleSQLiteAdapter(db, sessions, users);
|
const adapter = new DrizzleSQLiteAdapter(db, sessions, users);
|
||||||
|
|
||||||
export const lucia = new Lucia(adapter, {
|
export const lucia = new Lucia(adapter, {
|
||||||
sessionCookie: {
|
sessionCookie: {
|
||||||
expires: false,
|
expires: false,
|
||||||
attributes: {
|
attributes: {
|
||||||
secure: process.env.NODE_ENV=== "production",
|
secure: process.env.NODE_ENV === "production",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
getUserAttributes: (attributes) => {
|
getUserAttributes: (attributes) => {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { env } from "@/utils/env";
|
|
||||||
import Database from "better-sqlite3";
|
|
||||||
import { drizzle } from "drizzle-orm/better-sqlite3";
|
|
||||||
import * as schema from "@/server/db/schema";
|
import * as schema from "@/server/db/schema";
|
||||||
|
import { createClient } from "@libsql/client";
|
||||||
|
import { drizzle } from "drizzle-orm/libsql";
|
||||||
|
|
||||||
const sqlite = new Database(env.DB_PATH);
|
const sqlite = createClient({
|
||||||
|
url: "file:./db/sqlite.db",
|
||||||
|
});
|
||||||
export const db = drizzle(sqlite, { schema });
|
export const db = drizzle(sqlite, { schema });
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
|
|
||||||
import { db } from "@/server/db";
|
import { db } from "@/server/db";
|
||||||
|
import { migrate } from "drizzle-orm/libsql/migrator";
|
||||||
|
|
||||||
migrate(db, { migrationsFolder: "./drizzle" });
|
migrate(db, { migrationsFolder: "./drizzle" });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user