mirror of
https://github.com/R0m1k3/Menu.git
synced 2026-10-19 21:18:11 +02:00
feat: implement Prisma SQLite adapter, upgrade to Node 22, and improve container initialization and permissions
This commit is contained in:
1 parent
3f15c228f8
commit
9d4b1dabae
4 files changed
+52
-18
No files matched your search
+10
-7
@@ -1,9 +1,9 @@
|
||||
# Stage 1: Build
|
||||
FROM node:20-bookworm-slim AS builder
|
||||
FROM node:22-bookworm-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install build dependencies for better-sqlite3 and bcrypt
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3 \
|
||||
make \
|
||||
@@ -11,9 +11,6 @@ RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set a dummy database URL for build time
|
||||
ENV DATABASE_URL="file:./build.db"
|
||||
|
||||
COPY package*.json ./
|
||||
COPY prisma ./prisma/
|
||||
|
||||
@@ -25,19 +22,21 @@ COPY . .
|
||||
RUN npx prisma generate
|
||||
|
||||
# Build Next.js app
|
||||
ENV DATABASE_URL="file:./build.db"
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Runner
|
||||
FROM node:20-bookworm-slim AS runner
|
||||
FROM node:22-bookworm-slim AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# Install runtime dependencies for SQLite
|
||||
# Install runtime dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
openssl \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy standalone build and static files
|
||||
@@ -45,6 +44,10 @@ COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts
|
||||
|
||||
# Ensure prisma directory is accessible and writable for SQLite
|
||||
RUN mkdir -p /app/prisma && chmod -R 777 /app/prisma
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3214
|
||||
|
||||
Reference in new issue
Block a user