security(infra): harden compose exposure and split pytest out of runtime deps (#185, #186, #187) - #214
Merged
parthrohit22 merged 2 commits intoJul 27, 2026
Conversation
…ime deps - docker-compose.yml: drop host port bindings for postgres (5432) and redis (6379); both stay reachable only on the internal 'data' network. The API (8000) remains host-exposed (issue Second-Origin#186). - requirements.txt: remove pytest/iniconfig/pluggy from the runtime lockfile so the container image no longer ships a test framework (issue Second-Origin#185). - requirements-dev.txt: new file (-r requirements.txt + pytest stack) for CI and local dev. - pyproject.toml: move pytest into a [project.optional-dependencies] test extra so 'pip install .' is runtime-only. - ci.yml / release.yml: install requirements-dev.txt (or [test] extra) so pytest is present in CI without living in the runtime image. - .gitattributes: normalise line endings, keep lockfiles/requirements as text, mark binaries as binary (issue Second-Origin#187). Tested: backend suite 701 passed / 4 skipped; compose YAML validated.
parthrohit22
force-pushed
the
fix/185-186-187-infra-hardening
branch
from
July 27, 2026 12:41
dea973f to
ac963ad
Compare
This was referenced Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three infrastructure-hardening fixes: (1) the Compose stack no longer binds Postgres (5432) or Redis (6379) to the host — they stay reachable only on the internal
datanetwork, reducing self-hosted attack surface (#186); (2) pytest and its test-only deps are removed from the runtime dependency lockfile and moved to a dev/test requirements file + pyprojecttestextra, so the container image no longer ships a test framework (#185); (3) a.gitattributesnormalises line endings and keeps lockfiles/binaries handled consistently (#187).Linked issue
Related to #185 (pytest in runtime deps), #186 (compose host port exposure), #187 (.gitattributes). Closes #185, #186, #187.
Roadmap alignment
requirements.txtgrep-clean of pytest/iniconfig/pluggy;requirements-dev.txtcarries them;docker-compose.ymlre-validated as parseable YAML; backend suite 701 passed / 4 skipped.What changed
docker-compose.yml: removedports:forpostgresandredis; added comments.apikeeps8000host binding.apps/backend/requirements.txt: removedpytest,iniconfig,pluggy.apps/backend/requirements-dev.txt: new (-r requirements.txt+ the three test deps, pinned).apps/backend/pyproject.toml: pytest moved from coredependenciesto[project.optional-dependencies].test..github/workflows/ci.yml: both backend install steps userequirements-dev.txt..github/workflows/release.yml: install usesapps/backend[test]extra..gitattributes:text=auto eol=lf, lockfiles/requirements as text, binaries as-text.Acceptance criteria completed
.gitattributesadded with sensible text/binary rules.Testing performed
Screenshots
Not applicable (infra/config change).
Security and data considerations
internal: truenetwork, but host binding undermined that).Dependencies and blocked work
None.
Scope changes or remaining work
None. The
apiport (8000) is intentionally still host-exposed because the application must be reachable; only the data tier was closed off.Contributor checklist
devupstream/devCloses) is used only because the issue is fully resolved