Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ ENV GHOST_BUILD_VERSION=${GHOST_BUILD_VERSION}
USER ghost
ENV LD_PRELOAD=libjemalloc.so.2

# Boot once to warm Node's V8 compile cache — 15-20% off every container start.
# Must run here, as the runtime user: Node namespaces the cache directory by uid
# (and writes entries 0600), so a cache warmed by root in an earlier stage is one
# the runtime never looks at. Images built on top can re-run the script to cache
# their own code, as long as they do it as the same user.
RUN bin/warm-compile-cache.sh

EXPOSE 2368

CMD ["node", "index.js"]
Expand Down
7 changes: 1 addition & 6 deletions ghost/core/bin/validate-adapters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@
// e.g. bin/validate-adapters.js cache:Redis sso:ProSSO storage:S3Storage
//
// Adapters are named explicitly rather than read from config, which may not be
// present at build time. Run this as the user the image runs as: the modules it
// loads land in the V8 compile cache, which is namespaced by uid.
// present at build time

import {enableCompileCache} from 'node:module';
import {adapterPaths} from '../core/server/services/adapter-manager/adapter-paths';
import {baseClasses} from '../core/server/services/adapter-manager/base-classes';
import {loadAdapterClass} from '../core/server/services/adapter-manager/utils';

// No-op when NODE_COMPILE_CACHE is already set, as it is in Ghost's image.
enableCompileCache();

type AdapterType = keyof typeof baseClasses;

function validate(spec: string): void {
Expand Down
Loading