diff --git a/docker-compose.yml b/docker-compose.yml index 2316779..9b3a746 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -206,7 +206,10 @@ services: environment: *app-environment networks: [backend, egress] read_only: true - tmpfs: [/tmp] + # Swarm ignores the short `tmpfs:` key: a read-only container then has no + # writable /tmp at all. The long volume syntax is what a stack honours. + volumes: + - {type: tmpfs, target: /tmp, tmpfs: {size: 268435456}} healthcheck: test: [CMD-SHELL, 'python -c "import os,urllib.request; r=urllib.request.Request(\"http://localhost:8000/health\",headers={\"Host\":os.environ[\"PUBLIC_HOST\"]}); urllib.request.urlopen(r,timeout=3)"'] interval: 15s @@ -223,7 +226,8 @@ services: environment: *app-environment networks: [backend, egress] read_only: true - tmpfs: [/tmp] + # Print files are rendered here and can be hundreds of MB: on disk, not in memory. + volumes: [worker-tmp:/tmp] healthcheck: test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://localhost:8002/health',timeout=3)"] interval: 15s @@ -257,7 +261,9 @@ services: BACKUP_HOUR: ${BACKUP_HOUR:-3} networks: [backend, egress] read_only: true - tmpfs: [/tmp] + # In memory: a restore's private key is written here while it runs. + volumes: + - {type: tmpfs, target: /tmp, tmpfs: {size: 1073741824}} deploy: replicas: 1 restart_policy: {condition: on-failure, delay: 30s} @@ -323,6 +329,7 @@ configs: volumes: postgres-data: + worker-tmp: networks: backend: