fix(deploy): bound infrastructure container logs

This commit is contained in:
2026-09-02 15:30:29 +08:00
parent 9e0d2f6cdb
commit 25c4dd50b3
3 changed files with 39 additions and 0 deletions
@@ -28,6 +28,11 @@ const composeFiles = [
'deploy/docker-compose.overseas.yml',
];
const infrastructureComposeFiles = [
['deploy/docker-compose.rocketmq.yml', 3],
['docker-compose-infra.yml', 3],
];
test('deployable applications log only to stdout and stderr', () => {
for (const path of applicationConfigs) {
const source = readFileSync(path, 'utf8');
@@ -52,3 +57,19 @@ test('runtime image does not prepare an application log directory', () => {
const dockerfile = readFileSync('deploy/docker/Dockerfile', 'utf8');
assert.doesNotMatch(dockerfile, /\/app\/logs/);
});
test('infrastructure containers also use bounded local logs', () => {
for (const [path, expectedServiceCount] of infrastructureComposeFiles) {
const source = readFileSync(path, 'utf8');
assert.match(source, /x-bounded-logging:\s+&bounded-logging/, path);
assert.match(source, /driver:\s+local/, path);
assert.match(source, /DOCKER_LOG_MAX_SIZE/, path);
assert.match(source, /DOCKER_LOG_MAX_FILE/, path);
assert.equal(
source.match(/logging:\s+\*bounded-logging/g)?.length,
expectedServiceCount,
path,
);
assert.doesNotMatch(source, /driver:\s+json-file/, path);
}
});