flotilla/Dockerfile
Agent 91c17b5e0c Merge coracle upstream/dev into email-notifications
Brings the email-notifications feature (email digest settings UI + mail
adapter) onto the current coracle dev, resolving divergences with
upstream's newer notification-settings work:

- alerts page: upstream's saveNotificationSettings flow persists
  push/sound/badge + event reminders (re-arming syncEventReminders) and the
  feature's email block (Mail.register/enable + AppData email prefs) is
  preserved, mirroring prefs into the app-level store the push adapters read.
  Report-reminder UI wiring restored; single success toast.
- settings.ts: keeps feature's notificationSettings store + email salt,
  adopts upstream's updateSpaceAlert helpers + settingsFilter.
- +layout.svelte: Mail.sync() retained; signer alerts adopt upstream's
  syncSignerAlerts refactor.
- env.ts/Dockerfile: EMAIL_NOTIFICATION_SERVER + upstream's strict-equality
  fix and scripts/build/app.sh pipeline.
2026-10-01 17:12:42 -04:00

49 lines
2 KiB
Docker

# Build and run the Flotilla web server.
#
# docker build -t flotilla .
# docker run -p 3000:3000 flotilla
#
# Pass --build-arg VITE_BUILD_HASH=$(git rev-parse --short HEAD) to stamp the build.
# A .env in the build context is picked up by scripts/build/app.sh for branding config.
#
# Self-hosted deployments can override branding/feature settings by passing
# VITE_* build args below (e.g. VITE_EMAIL_NOTIFICATION_SERVER). Unset args keep
# the value from the tracked .env (scripts/build/web.sh sources it and restores the
# exported environment), so local overrides never clobber upstream defaults.
# https://pnpm.io/docker#example-3-build-on-cicd
FROM node:24-slim AS builder
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
ENV NODE_OPTIONS=--max_old_space_size=16384
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages ./packages
RUN pnpm i --frozen-lockfile
COPY . .
ARG VITE_BUILD_HASH
ARG VITE_PLATFORM_URL
ARG VITE_PLATFORM_NAME
ARG VITE_PLATFORM_DESCRIPTION
ARG VITE_PLATFORM_ACCENT
ARG VITE_PLATFORM_SECONDARY
ARG VITE_DEFAULT_PUBKEYS
ARG VITE_PLATFORM_LOGO
ARG VITE_PLATFORM_RELAYS
ARG VITE_EMAIL_NOTIFICATION_SERVER
RUN bash -c 'for v in VITE_BUILD_HASH VITE_PLATFORM_URL VITE_PLATFORM_NAME VITE_PLATFORM_DESCRIPTION VITE_PLATFORM_ACCENT VITE_PLATFORM_SECONDARY VITE_DEFAULT_PUBKEYS VITE_PLATFORM_LOGO VITE_PLATFORM_RELAYS VITE_EMAIL_NOTIFICATION_SERVER; do if [ -n "${!v}" ]; then export "$v=${!v}"; fi; done; pnpm run build'
RUN bash -c 'for v in VITE_BUILD_HASH VITE_PLATFORM_URL VITE_PLATFORM_NAME VITE_PLATFORM_DESCRIPTION VITE_PLATFORM_ACCENT VITE_PLATFORM_SECONDARY VITE_DEFAULT_PUBKEYS VITE_PLATFORM_LOGO VITE_PLATFORM_RELAYS VITE_EMAIL_NOTIFICATION_SERVER; do if [ -n "${!v}" ]; then export "$v=${!v}"; fi; done; pnpm run build:server'
FROM node:24-slim AS production
ENV NODE_ENV=production
WORKDIR /app
COPY --from=builder /app/build /app/build
# The bundle splits, and the chunks it imports at runtime sit beside it.
COPY --from=builder /app/build-server/ /app/
EXPOSE 3000
USER node
CMD ["node", "server.js"]