mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore: cleanup images (#14380)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added canary build version support with automatic validation and age-based restrictions for testing pre-release versions. * **Chores** * Enhanced Docker build process with multi-stage builds, image optimization, and memory allocation improvements. * Reorganized dependencies to distinguish development-only packages. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
19
.github/deployment/node/Dockerfile
vendored
19
.github/deployment/node/Dockerfile
vendored
@@ -1,11 +1,28 @@
|
||||
FROM node:22-bookworm-slim
|
||||
# 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/*
|
||||
|
||||
Reference in New Issue
Block a user