After .env was removed from the repo (D20026), docker builds without a .env in the context (including @bot preview-cashtab) blank the app with Uncaught Error: Missing required parameters: sitekey. Copy env.sample to .env before the Vite build only when .env is absent so prod/local overrides in the build context are preserved.
Details
- Reviewers
Fabien - Group Reviewers
Restricted Project - Commits
- rABC849c06f15da7: [Cashtab] Copy env.sample in Docker build when .env is missing
- docker build -f cashtab.Dockerfile --build-arg NGINX_CONF=nginx-preview.conf -t cashtab_preview .
- docker run --rm -p 8080:80 cashtab_preview
- Open localhost:8080; app loads (no blank screen / sitekey console error)
- With a real cashtab/.env present in the build context, confirm it is not overwritten
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Revert Dockerfile change; preview-only pre_build instead. Prod creates .env outside cashtab.Dockerfile. Add docker.pre_build hook and use it only for preview-cashtab to copy env.sample into the build context before docker build.
Build Bitcoin ABC Diffs / Diff Testing (ai-review) passed.
CodeRabbit Review
Diff : committed changes only
Compare : HEAD → master
Directory : work
────────────────────────────────────────
(\(\
(• .•) HD, 4K, 8K...I see bugs in all resolutions.
────────────────────────────────────────
Review complete
No findings ✔
1 file reviewed:
- cashtab.Dockerfile
────────────────────────────────────────
Build Bitcoin ABC Diffs / Diff Testing (ai-review) passed.
CodeRabbit Review
Diff : committed changes only
Compare : HEAD → master
Directory : work
────────────────────────────────────────
(\(\
(• .•) CodeRabbi is my uncle. He's a bit more orthodox. Feel lucky you got me instead.
────────────────────────────────────────
Review complete
No findings ✔
2 files reviewed:
- contrib/teamcity/build-configurations.py
- contrib/teamcity/build-configurations.yml
────────────────────────────────────────
Build Bitcoin ABC Diffs / Diff Testing (preview-cashtab) passed.
Preview is available at http://54.39.19.73:41981 for the next 60 minutes.
you'd better do the copy in the dockerfile if there no .env already, so it also works outside of CI environment. This also let people override the sample with their value and the build will work as expected
Address review: drop docker.pre_build; copy env.sample in cashtab.Dockerfile only when .env is missing so prod/local overrides are preserved.
Address review: copy env.sample in cashtab.Dockerfile only when .env is missing. Dropped the docker.pre_build CI hook. Rebased onto master so the diff is Dockerfile-only.
Build Bitcoin ABC Diffs / Diff Testing (ai-review) passed.
CodeRabbit Review
Diff : committed changes only
Compare : HEAD → master
Directory : work
────────────────────────────────────────
(\(\
(• .•) RabbitCop: To debug and serve.
────────────────────────────────────────
Review complete
No findings ✔
2 files reviewed:
- cashtab.Dockerfile
- contrib/teamcity/build-configurations.yml
────────────────────────────────────────
Build Bitcoin ABC Diffs / Diff Testing (ai-review) passed.
CodeRabbit Review
Diff : committed changes only
Compare : HEAD → master
Directory : work
────────────────────────────────────────
(\(\
(• .•) Tabs vs spaces? You somehow chose violence *and* confusion.
────────────────────────────────────────
Review complete
No findings ✔
1 file reviewed:
- cashtab.Dockerfile
────────────────────────────────────────
Build Bitcoin ABC Diffs / Diff Testing (preview-cashtab) passed.
Preview is available at http://51.83.66.92:41542 for the next 60 minutes.