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
|
||||
RUN mkdir -p /usr/src/app
|
||||
@ -14,7 +14,11 @@ COPY package.json /usr/src/app
|
||||
COPY pnpm-lock.yaml /usr/src/app
|
||||
|
||||
# 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
|
||||
RUN corepack enable pnpm
|
||||
|
@ -4,14 +4,38 @@
|
||||
IMAGE_NAME="myp-rp"
|
||||
IMAGE_TAG="latest"
|
||||
|
||||
# Build the Docker image from Containerfile
|
||||
echo "Building Docker image from Containerfile..."
|
||||
docker build -t ${IMAGE_NAME}:${IMAGE_TAG} -f $PWD/Containerfile $PWD
|
||||
# Create a new builder instance with a sensible name
|
||||
BUILDER_NAME="myp-rp-arm64-builder"
|
||||
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
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error occurred while building the Docker image"
|
||||
docker buildx rm $BUILDER_NAME
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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",
|
||||
schema: "./src/server/db/schema.ts",
|
||||
out: "./drizzle",
|
||||
driver: "better-sqlite",
|
||||
driver: "libsql",
|
||||
dbCredentials: {
|
||||
url: "db/sqlite.db",
|
||||
url: "file:./db/sqlite.db",
|
||||
},
|
||||
});
|
||||
|
@ -16,58 +16,57 @@
|
||||
"db:reset": "pnpm db:clean && pnpm db"
|
||||
},
|
||||
"dependencies": {
|
||||
"@headlessui/react": "^2.0.3",
|
||||
"@headlessui/tailwindcss": "^0.2.0",
|
||||
"@hookform/resolvers": "^3.3.4",
|
||||
"@lucia-auth/adapter-drizzle": "^1.0.7",
|
||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||
"@radix-ui/react-avatar": "^1.0.4",
|
||||
"@radix-ui/react-dialog": "^1.0.5",
|
||||
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
||||
"@radix-ui/react-hover-card": "^1.0.7",
|
||||
"@headlessui/react": "^2.1.9",
|
||||
"@headlessui/tailwindcss": "^0.2.1",
|
||||
"@hookform/resolvers": "^3.9.0",
|
||||
"@libsql/client": "^0.14.0",
|
||||
"@lucia-auth/adapter-drizzle": "^1.1.0",
|
||||
"@radix-ui/react-alert-dialog": "^1.1.2",
|
||||
"@radix-ui/react-avatar": "^1.1.1",
|
||||
"@radix-ui/react-dialog": "^1.1.2",
|
||||
"@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-label": "^2.0.2",
|
||||
"@radix-ui/react-scroll-area": "^1.0.5",
|
||||
"@radix-ui/react-select": "^2.0.0",
|
||||
"@radix-ui/react-slot": "^1.0.2",
|
||||
"@radix-ui/react-tabs": "^1.0.4",
|
||||
"@radix-ui/react-toast": "^1.1.5",
|
||||
"@radix-ui/react-label": "^2.1.0",
|
||||
"@radix-ui/react-scroll-area": "^1.2.0",
|
||||
"@radix-ui/react-select": "^2.1.2",
|
||||
"@radix-ui/react-slot": "^1.1.0",
|
||||
"@radix-ui/react-tabs": "^1.1.1",
|
||||
"@radix-ui/react-toast": "^1.2.2",
|
||||
"@remixicon/react": "^4.2.0",
|
||||
"@tanstack/react-table": "^8.16.0",
|
||||
"@tremor/react": "^3.16.2",
|
||||
"arctic": "^1.8.1",
|
||||
"better-sqlite3": "^9.6.0",
|
||||
"@tanstack/react-table": "^8.20.5",
|
||||
"@tremor/react": "^3.18.3",
|
||||
"arctic": "^1.9.2",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.1.1",
|
||||
"drizzle-orm": "^0.30.10",
|
||||
"lucia": "^3.2.0",
|
||||
"lucia": "^3.2.1",
|
||||
"lucide-react": "^0.378.0",
|
||||
"next": "14.2.3",
|
||||
"next-themes": "^0.3.0",
|
||||
"oslo": "^1.2.0",
|
||||
"oslo": "^1.2.1",
|
||||
"react": "^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-timer-hook": "^3.0.7",
|
||||
"regression": "^2.0.1",
|
||||
"sonner": "^1.4.41",
|
||||
"sonner": "^1.5.0",
|
||||
"swr": "^2.2.5",
|
||||
"tailwind-merge": "^2.3.0",
|
||||
"tailwind-merge": "^2.5.3",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"use-debounce": "^10.0.0",
|
||||
"use-debounce": "^10.0.3",
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.7.3",
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
"@types/better-sqlite3": "^7.6.10",
|
||||
"@types/node": "^20.12.11",
|
||||
"@types/react": "^18.3.1",
|
||||
"@biomejs/biome": "^1.9.3",
|
||||
"@tailwindcss/forms": "^0.5.9",
|
||||
"@types/node": "^20.16.11",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"drizzle-kit": "^0.21.1",
|
||||
"postcss": "^8.4.38",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"typescript": "^5.4.5"
|
||||
"drizzle-kit": "^0.21.4",
|
||||
"postcss": "^8.4.47",
|
||||
"tailwindcss": "^3.4.13",
|
||||
"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 { cache } from "react";
|
||||
|
||||
//@ts-ignore
|
||||
const adapter = new DrizzleSQLiteAdapter(db, sessions, users);
|
||||
|
||||
export const lucia = new Lucia(adapter, {
|
||||
sessionCookie: {
|
||||
expires: false,
|
||||
attributes: {
|
||||
secure: process.env.NODE_ENV=== "production",
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
},
|
||||
},
|
||||
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 { 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 });
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
|
||||
import { db } from "@/server/db";
|
||||
import { migrate } from "drizzle-orm/libsql/migrator";
|
||||
|
||||
migrate(db, { migrationsFolder: "./drizzle" });
|
||||
|
Loading…
x
Reference in New Issue
Block a user