Run 2346 named the cause, and it was not Docker and not the stack:
error mounting "/workspace/para/openwaf/deploy/upstream.conf" to rootfs at
"/etc/nginx/conf.d/default.conf": not a directory: Are you trying to mount a
directory onto a file (or vice-versa)?
The job's workspace lives inside the runner's job container; the docker daemon is
the host's, reached through /var/run/docker.sock. A relative bind mount written in
docker-compose.yml is resolved by the daemon on the host, where that path does not
exist, so Docker turns it into a directory and the mount dies. deploy/upstream.conf
is tracked (b6126c2) — this was never a checkout problem.
docker-compose.ci.yml is the overlay: the upstream service gets its config from a
named volume at /etc/nginx/conf.d, filled by a step that pipes the tracked file
into the volume. `!override` replaces the base volumes list, otherwise the broken
mount would still sit next to the working one. Compose reads the overlay through
COMPOSE_FILE, which only the workflow sets — a laptop and the README demo keep the
plain file mount, and the gate scripts stay the scripts an operator runs.
Verified before pushing, on this tree: `docker compose config` shows the upstream
volumes as the named volume at /etc/nginx/conf.d with the bind mount gone; the
fill step writes 1209 bytes, exactly deploy/upstream.conf; scripts/compose-smoke.sh
under COMPOSE_FILE=docker-compose.yml:docker-compose.ci.yml reports 348 passed /
0 failed, including the 502-upstream scenes that need that config to be read.
28 lines
1.3 KiB
YAML
28 lines
1.3 KiB
YAML
# The CI overlay. It changes nothing about what the stack is — only about how
|
|
# nginx's config gets into the upstream container.
|
|
#
|
|
# Why it exists, measured on Gitea Actions run 2346 (head 1ada354): the job's
|
|
# workspace is a path inside the runner's job container, while the docker daemon
|
|
# is the host's, reached through a mounted /var/run/docker.sock. A relative bind
|
|
# mount written in docker-compose.yml is resolved by the daemon on the host,
|
|
# where /workspace/para/openwaf/deploy/upstream.conf does not exist, so Docker
|
|
# makes a directory out of it and the mount dies:
|
|
# not a directory: Are you trying to mount a directory onto a file (or
|
|
# vice-versa)?
|
|
# A named volume carries the same bytes on a path the daemon owns. The CI step
|
|
# that fills it is in .github/workflows/ci.yml; compose names the volume
|
|
# "<COMPOSE_PROJECT_NAME>_openwaf-upstream-conf", which is what that step creates.
|
|
#
|
|
# `!override` replaces the base volumes list instead of appending to it — without
|
|
# it the broken file mount would still be there next to this one.
|
|
#
|
|
# Local runs and the README demo do not use this file: compose only reads it when
|
|
# COMPOSE_FILE names it, which only the workflow does.
|
|
services:
|
|
upstream:
|
|
volumes: !override
|
|
- openwaf-upstream-conf:/etc/nginx/conf.d:ro
|
|
|
|
volumes:
|
|
openwaf-upstream-conf:
|