Web app ready

This commit is contained in:
2026-06-06 17:08:04 +02:00
parent ff187a5bd4
commit 3e127afbae
39 changed files with 2622 additions and 123 deletions
+38
View File
@@ -0,0 +1,38 @@
# ── Stage 1: deps ─────────────────────────────────────────────────────────────
FROM node:24-alpine3.21 AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# ── Stage 2: builder ──────────────────────────────────────────────────────────
FROM node:24-alpine3.21 AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
# ── Stage 3: runner ───────────────────────────────────────────────────────────
FROM node:24-alpine3.21 AS runner
WORKDIR /app
ENV NODE_ENV=production
# DATA_DIR is the single volume mount point for both SQLite and uploads
ENV DATA_DIR=/data
# Create a non-root user
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs && \
mkdir -p /data/uploads && chown -R nextjs:nodejs /data
# Copy standalone build output
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
CMD ["node", "server.js"]