Skip to content

Commit 9fe0a7d

Browse files
authored
Merge pull request #2034 from nightcityblade/fix/issue-2027
fix(docker): make read-only tmpfs writable
2 parents c66f327 + c8aee8c commit 9fe0a7d

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎deploy/docker/tests/test_security_container_posture.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ def test_no_host_dev_shm_bind(self, compose):
9393
def test_pids_limit(self, compose):
9494
assert "pids_limit" in compose
9595

96+
def test_read_only_runtime_tmpfs_are_appuser_owned(self, compose):
97+
assert "/var/lib/redis:uid=999,gid=999,mode=0700" in compose
98+
assert "/var/lib/crawl4ai/outputs:uid=999,gid=999,mode=0700" in compose
99+
assert "/home/appuser/.crawl4ai:uid=999,gid=999,mode=0700" in compose
100+
assert "/home/appuser/.gunicorn:uid=999,gid=999,mode=0700" in compose
101+
102+
def test_playwright_cache_is_not_shadowed(self, compose):
103+
assert "/home/appuser/.cache\n" not in compose
104+
assert "/home/appuser/.cache/url_seeder:uid=999,gid=999,mode=0700" in compose
105+
96106

97107
class TestEntrypoint:
98108
def test_entrypoint_exists_and_resolves_bind(self):

‎docker-compose.yml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ x-base-config: &base-config
2929
read_only: true
3030
tmpfs:
3131
- /tmp
32-
- /var/lib/redis
33-
- /var/lib/crawl4ai/outputs:mode=0700
34-
- /home/appuser/.cache
32+
- /var/lib/redis:uid=999,gid=999,mode=0700
33+
- /var/lib/crawl4ai/outputs:uid=999,gid=999,mode=0700
34+
- /home/appuser/.crawl4ai:uid=999,gid=999,mode=0700
35+
# Keep the baked Playwright browser under ~/.cache/ms-playwright visible.
36+
- /home/appuser/.cache/url_seeder:uid=999,gid=999,mode=0700
37+
- /home/appuser/.gunicorn:uid=999,gid=999,mode=0700
3538
deploy:
3639
resources:
3740
limits:

0 commit comments

Comments
 (0)