Skip to content

Commit 8bbfe6c

Browse files
committed
perf(docker): add apcu
Signed-off-by: skjnldsv <[email protected]>
1 parent f4d8ade commit 8bbfe6c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/docker.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export async function startNextcloud(branch = 'master', mountApp: boolean|string
173173
const container = await docker.createContainer({
174174
Image: SERVER_IMAGE,
175175
name: getContainerName(),
176-
Env: [`BRANCH=${branch}`],
176+
Env: [`BRANCH=${branch}`, 'APCU=1'],
177177
HostConfig: {
178178
Binds: mounts.length > 0 ? mounts : undefined,
179179
PortBindings,
@@ -228,6 +228,19 @@ export const configureNextcloud = async function(apps = ['viewer'], vendoredBran
228228
await runExec(container, ['php', 'occ', 'config:system:set', 'force_locale', '--value', 'en_US'], true)
229229
await runExec(container, ['php', 'occ', 'config:system:set', 'enforce_theme', '--value', 'light'], true)
230230

231+
// Checking apcu
232+
console.log('├─ Checking APCu configuration... 👀')
233+
const distributed = await runExec(container, ['php', 'occ', 'config:system:get', 'memcache.distributed'])
234+
const local = await runExec(container, ['php', 'occ', 'config:system:get', 'memcache.local'])
235+
const hashing = await runExec(container, ['php', 'occ', 'config:system:get', 'hashing_default_password'])
236+
if (!distributed.includes('Memcache\\APCu')
237+
|| !local.includes('Memcache\\APCu')
238+
|| !hashing.includes('true')) {
239+
console.log('└─ APCu is not properly configured 🛑')
240+
throw new Error('APCu is not properly configured')
241+
}
242+
console.log('│ └─ OK !')
243+
231244
// Build app list
232245
const json = await runExec(container, ['php', 'occ', 'app:list', '--output', 'json'], false)
233246
// fix dockerode bug returning invalid leading characters

0 commit comments

Comments
 (0)