π€ AI text below π€
Finding
The container's identity β install path, service name, entrypoint, and port β is written out by hand in every file that needs it. A rename or a port change has to touch all of them, and nothing fails when one is missed.
Install path and entrypoint
dockerfile: ADD . /opt/bat, WORKDIR /opt/bat, ENTRYPOINT ["bat"], CMD ["start"]. The entrypoint is the console-script name declared in pyproject.toml and setup.py; start is a CLI subcommand.
docker-compose.dev.yaml: bind-mounts ./:/opt/bat, repeating the dockerfile's WORKDIR.
Service name
docker-compose.yaml and docker-compose.dev.yaml both name the service bat.
Port
- both compose files:
"5000:5000"
bat/server/server.py: start_server(..., port='5000') and start_api_server(..., port='5000')
bat/server/cli.py: --port default '5000'
container_tests/container_test.py: 'http://0.0.0.0:5000/', twice
The drift is not hypothetical
Two references on main are already stale, both survivors of an earlier rename:
docker-compose.dev.yaml comments the bind mount as # Override /opt/project with local dir in dev β it names a path the image no longer uses.
container_tests/container_test.py:6 does from project.tests.common_api_tests import CommonAPITest, a package name that no longer exists.
Neither broke a check, because nothing points at a single definition.
Suggested direction
Give each fact one home and reference it everywhere else:
- the install path as a build
ARG used by ADD and WORKDIR, mirrored once in the dev compose mount;
- the port as one value both the compose files and the server default read β compose substitutes
${APP_PORT:-5000} from a .env file, and the server CLI already routes --port through server.port;
- the test service address derived from that value instead of a literal.
The mechanism matters less than the outcome: renaming or re-porting a fresh copy of the template should be a change in one place, not a grep for bat and 5000 across five files.
π€ AI text below π€
Finding
The container's identity β install path, service name, entrypoint, and port β is written out by hand in every file that needs it. A rename or a port change has to touch all of them, and nothing fails when one is missed.
Install path and entrypoint
dockerfile:ADD . /opt/bat,WORKDIR /opt/bat,ENTRYPOINT ["bat"],CMD ["start"]. The entrypoint is the console-script name declared inpyproject.tomlandsetup.py;startis a CLI subcommand.docker-compose.dev.yaml: bind-mounts./:/opt/bat, repeating the dockerfile'sWORKDIR.Service name
docker-compose.yamlanddocker-compose.dev.yamlboth name the servicebat.Port
"5000:5000"bat/server/server.py:start_server(..., port='5000')andstart_api_server(..., port='5000')bat/server/cli.py:--portdefault'5000'container_tests/container_test.py:'http://0.0.0.0:5000/', twiceThe drift is not hypothetical
Two references on
mainare already stale, both survivors of an earlier rename:docker-compose.dev.yamlcomments the bind mount as# Override /opt/project with local dir in devβ it names a path the image no longer uses.container_tests/container_test.py:6doesfrom project.tests.common_api_tests import CommonAPITest, a package name that no longer exists.Neither broke a check, because nothing points at a single definition.
Suggested direction
Give each fact one home and reference it everywhere else:
ARGused byADDandWORKDIR, mirrored once in the dev compose mount;${APP_PORT:-5000}from a.envfile, and the server CLI already routes--portthroughserver.port;The mechanism matters less than the outcome: renaming or re-porting a fresh copy of the template should be a change in one place, not a grep for
batand5000across five files.