push to maple-street

This commit is contained in:
Tiel Coder
2026-11-20 04:07:02 +00:00
parent 2cec220a24
commit 5adf1cef1f
345 changed files with 86105 additions and 1079 deletions
+23 -3
View File
@@ -7,6 +7,10 @@
FROM node:22-alpine AS base
WORKDIR /app
ENV NODE_ENV=production
# ImageMagick's LibRaw delegate decodes camera RAW files for the in-app editor;
# sharp does the tone rendering and JPEG encode. The Postgres client provides
# pg_dump/psql for admin backups and restores; unzip reads restore packages.
RUN apk add --no-cache imagemagick libraw ffmpeg postgresql16-client unzip
# pnpm is how this project is built (see package.json scripts).
RUN npm install -g pnpm@9.15.0
@@ -18,22 +22,38 @@ RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM node:22-alpine AS runner
# ---------------------------------------------------------------------------
# Tools stage — migrations + seed run from the builder image, which has the
# source, `drizzle/` and dev dependencies (drizzle-kit, tsx). Keeping them out of
# the runner keeps the serving image lean.
# ---------------------------------------------------------------------------
FROM builder AS tools
ENV NODE_ENV=development
CMD ["sh", "-c", "pnpm db:migrate && pnpm db:seed"]
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
# pnpm runs the app in production (see package.json scripts).
RUN npm install -g pnpm@9.15.0
# Inherits pnpm and the ImageMagick/LibRaw runtime tools from `base`.
# Run as a non-root user (busybox adduser/addgroup on alpine).
RUN addgroup -S nodegrp \
&& adduser -S -G nodegrp -H -D nextjs
# Some ImageMagick temporary work happens under /tmp; it is writable by all.
RUN chmod 1777 /tmp
# Build output, deps, static assets.
COPY --from=builder --chown=nextjs:nodegrp /app/public ./public
COPY --from=builder --chown=nextjs:nodegrp /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodegrp /app/package.json ./package.json
COPY --from=builder --chown=nextjs:nodegrp /app/.next ./.next
# The console email transport writes here. Create it in the image owned by the
# runtime user so a mounted named volume inherits that ownership (a root-owned
# volume made every send fail with EACCES in the first deploy).
RUN mkdir -p /tmp/outbox /tmp/uploads /archive && chown -R nextjs:nodegrp /tmp/outbox /tmp/uploads /archive
USER nextjs
EXPOSE 3000
ENV PORT=3000