-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.single-instance.yml
More file actions
44 lines (42 loc) · 2.59 KB
/
Copy pathdocker-compose.single-instance.yml
File metadata and controls
44 lines (42 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Runs the stack without Redis, for a deployment that is one replica of `core`.
#
# docker compose -f docker-compose.yml -f docker-compose.single-instance.yml up -d
#
# Redis carries two things, and neither is a source of truth. The permission cache is stamped with
# a hash of the stored rules, so losing it costs three reads and never correctness - the database
# decides who may do what. The job lease stops every replica from running the same nightly archive
# pass; the passes are idempotent, so it guards contention rather than data. With one replica both
# collapse into this process, exactly and not approximately.
#
# The cost is the assumption. Scale `core` past one with this file and every replica leads its own
# archive cycle, every one sweeps the tracker, and a revoked permission lingers in the others until
# the stamp expires. Nothing can detect that from inside - each process would hold its own lease and
# believe it leads - which is why Coordination__SingleInstance is a statement an operator makes
# rather than a default. If you scale up, drop this file and bring Redis back.
#
# Verified as far as this environment allows, and no further. `docker compose config` renders the
# merge: redis and its volume drop out of the model, Redis__ConnectionString is gone, and core is
# left depending on mssql and rabbitmq alone. The application half is covered by tests - the
# container builds and resolves with no Redis configured at all, and `memory` refuses to start
# without the assertion above. What has NOT happened is the stack actually running: the Docker
# registry is filtered here, so no image was ever pulled and no container ever started.
services:
core:
environment:
Coordination__Provider: memory
Coordination__SingleInstance: "true"
# Nothing reads it in this mode, and leaving it set invites the belief that it is being used.
Redis__ConnectionString: !reset null
# Merged, not !override: overriding the whole map would drop what another override file put
# there, and the two are meant to combine - this plus postgres.yml is a valid deployment.
# `required: false` is what removes a dependency without erasing the map: the profiled-out
# service is not started, and Compose warns instead of refusing the project.
depends_on:
redis:
condition: service_healthy
required: false
# Declared with a profile nothing enables, so `up` does not start it. The service stays in the
# model rather than being deleted, so `docker compose config` still describes the full stack and
# switching back is dropping this file.
redis:
profiles: ["never"]