Skip to content

Commit

Permalink
perf(docker): add apcu
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <[email protected]>
  • Loading branch information
skjnldsv committed Aug 22, 2024
1 parent f4d8ade commit 8bbfe6c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export async function startNextcloud(branch = 'master', mountApp: boolean|string
const container = await docker.createContainer({
Image: SERVER_IMAGE,
name: getContainerName(),
Env: [`BRANCH=${branch}`],
Env: [`BRANCH=${branch}`, 'APCU=1'],
HostConfig: {
Binds: mounts.length > 0 ? mounts : undefined,
PortBindings,
Expand Down Expand Up @@ -228,6 +228,19 @@ export const configureNextcloud = async function(apps = ['viewer'], vendoredBran
await runExec(container, ['php', 'occ', 'config:system:set', 'force_locale', '--value', 'en_US'], true)
await runExec(container, ['php', 'occ', 'config:system:set', 'enforce_theme', '--value', 'light'], true)

// Checking apcu
console.log('├─ Checking APCu configuration... 👀')
const distributed = await runExec(container, ['php', 'occ', 'config:system:get', 'memcache.distributed'])
const local = await runExec(container, ['php', 'occ', 'config:system:get', 'memcache.local'])
const hashing = await runExec(container, ['php', 'occ', 'config:system:get', 'hashing_default_password'])
if (!distributed.includes('Memcache\\APCu')
|| !local.includes('Memcache\\APCu')
|| !hashing.includes('true')) {
console.log('└─ APCu is not properly configured 🛑')
throw new Error('APCu is not properly configured')
}
console.log('│ └─ OK !')

// Build app list
const json = await runExec(container, ['php', 'occ', 'app:list', '--output', 'json'], false)
// fix dockerode bug returning invalid leading characters
Expand Down

0 comments on commit 8bbfe6c

Please sign in to comment.