feat: add better auth sqlite runtime and server-side session flow
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
FROM node:22-bookworm-slim AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
FROM node:22-bookworm-slim AS builder
|
||||
WORKDIR /app
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-bookworm-slim AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
ENV PORT=3000
|
||||
ENV DATA_DIR=/app/data
|
||||
|
||||
RUN groupadd --system --gid 1001 nodejs \
|
||||
&& useradd --system --uid 1001 --gid nodejs nextjs \
|
||||
&& mkdir -p /app/data \
|
||||
&& chown -R nextjs:nodejs /app/data
|
||||
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/scripts ./scripts
|
||||
COPY --from=builder /app/server/db/migrations ./server/db/migrations
|
||||
COPY --from=builder /app/node_modules/drizzle-orm ./node_modules/drizzle-orm
|
||||
COPY --from=builder /app/node_modules/better-sqlite3 ./node_modules/better-sqlite3
|
||||
COPY --from=builder /app/node_modules/bindings ./node_modules/bindings
|
||||
COPY --from=builder /app/node_modules/file-uri-to-path ./node_modules/file-uri-to-path
|
||||
|
||||
USER nextjs
|
||||
EXPOSE 3000
|
||||
VOLUME ["/app/data"]
|
||||
CMD ["sh", "-c", "node scripts/migrate.mjs && node server.js"]
|
||||
Reference in New Issue
Block a user