Files
AFFiNE/.github/deployment/node/Dockerfile
T
DarkSky 7afb62d5b4 feat(server): improve config loading (#15649)
fix #15650
fix #15530
fix #15534
fix #15506


#### PR Dependency Tree


* **PR #15649** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary

* **New Features**
* Admin settings show configuration sources and secret status, conceal
secret values, and allow database-level overrides to be cleared.
* Self-hosted deployments can automatically upgrade existing
configuration files.
* **Improvements**
* Configuration changes apply without restarting the server, and storage
settings reload automatically.
* Uploads support runtime-managed proxy settings and signed upload
tokens.
  * Incomplete managed Copilot profiles are disabled during migration.
* Saving an AI response as a document more reliably targets the matching
editor.
* **Documentation**
* The CLI clarifies that imported configuration changes take effect
after the next server start.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-30 00:39:36 +08:00

36 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1.7
FROM node:22-bookworm-slim AS assets
WORKDIR /app
COPY ./packages/backend/server /app
COPY ./packages/frontend/apps/web/dist /app/static
COPY ./packages/frontend/admin/dist /app/static/admin
COPY ./packages/frontend/apps/mobile/dist /app/static/mobile
# Keep server sourcemap for stacktraces, but don't ship frontend/node_modules sourcemaps.
ARG TARGETARCH
ARG TARGETVARIANT
# Needed for Prisma engine resolution (and potential engine download during cleanup).
RUN apt-get update && \
apt-get install -y --no-install-recommends openssl ca-certificates && \
rm -rf /var/lib/apt/lists/*
RUN AFFINE_DOCKER_CLEAN=1 TARGETARCH="${TARGETARCH}" TARGETVARIANT="${TARGETVARIANT}" node ./scripts/docker-clean.mjs
FROM node:22-bookworm-slim
WORKDIR /app
COPY --from=assets /app /app
RUN apt-get update && \
apt-get install -y --no-install-recommends openssl libjemalloc2 && \
rm -rf /var/lib/apt/lists/*
# Enable jemalloc by preloading the library
ENV LD_PRELOAD=libjemalloc.so.2
EXPOSE 3010
CMD ["sh", "-c", "node ./scripts/upgrade-config.js && exec node ./dist/main.js"]