Files
Elternbeirat/compose.test.yaml

32 lines
1.7 KiB
YAML

# Test overlay: layered on top of compose.yaml + compose.dev.yaml, used only by the
# integration tests (PocketBaseFixture). Its single job is to drop the fixed host
# port 8090 the dev overlay binds, so the test stack does not fight the running dev
# stack over that port. An empty host port ("8090" alone) lets Docker pick a random
# free one; the tests read it back with `docker compose port`.
#
# docker compose -f compose.yaml -f compose.dev.yaml -f compose.test.yaml ...
services:
eb-pocketbase:
# Drop the fixed name from the base so compose auto-names the container
# (eb-test-stack-eb-pocketbase-1). That keeps the test stack from fighting a
# running dev stack -- which keeps the readable fixed names -- over the name
# "eb-pocketbase". ("!reset null" clears the inherited scalar value.)
container_name: !reset null
# !override replaces the whole inherited ports list (a plain list would merge
# additively and keep the dev overlay's 8090:8090). "8090" without a host port
# lets Docker pick a random free one; the tests read it back with `compose port`.
ports: !override
- "8090"
# Drop the dev overlay's pb_migrations bind mount. The tests must NOT run the
# dev seed -- it would insert the dev data set, which the tests do not assert
# against (and which lacks the fixtures' draft page, known event time, etc.).
# The fixture creates the collections itself by importing the shared schema
# file, then seeds its own fixed records. !override replaces the inherited
# volumes list; the throwaway pb_data volume is re-declared so it survives.
volumes: !override
- pb_data_dev:/pb_data
eb-web:
container_name: !reset null # see eb-pocketbase above (eb-web is not started in tests)