mailship/Dockerfile
Agent 75f5908039 Strip out the web UI (login + subscription filter management)
Remove the browser admin SPA under web/ that let users log in via
a Nostr signer and manage subscription filters. The server is now
a headless API only.

Changes:
- Delete web/ directory entirely (SPA source, config, deps)
- Remove express.static('web/dist') serving from server.ts
- Simplify GET / handler to always return JSON (no fallback)
- Remove build:web from package.json build pipeline
- Remove web build steps from Dockerfile
- Remove web references from build-in-production.sh

Kept: core subscription/unsubscribe/confirm/notify backend and
transactional src/pages/*.html (part of email flow, not the UI).
2026-09-10 10:08:14 -04:00

61 lines
No EOL
1.4 KiB
Docker

# syntax=docker/dockerfile:1
FROM node:22-alpine AS build
WORKDIR /app
# Install build dependencies for native modules
RUN apk add --no-cache python3 make g++ git
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# Copy package files
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY remove-pnpm-overrides.js ./
# Remove pnpm link overrides for production build
RUN node remove-pnpm-overrides.js package.json
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy source
COPY tsconfig.json ./
COPY src/ ./src/
COPY src/pages/ ./src/pages/
COPY src/emails/ ./src/emails/
# Build TypeScript (runs tsc && build:html)
RUN pnpm run build
# Production image
FROM node:22-alpine AS production
WORKDIR /app
RUN apk add --no-cache sqlite
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# Copy production dependencies
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY remove-pnpm-overrides.js ./
RUN node remove-pnpm-overrides.js package.json
RUN pnpm install --frozen-lockfile --prod
# Copy build artifacts
COPY --from=build /app/dist/ ./dist/
COPY --from=build /app/src/pages/ ./dist/pages/
COPY --from=build /app/src/emails/ ./dist/emails/
# Create data directory for SQLite
RUN mkdir -p /data
EXPOSE 4738
ENV NODE_ENV=production
ENV PORT=4738
ENV DATA_DIR=/data
CMD ["node", "dist/index.js"]