-
Notifications
You must be signed in to change notification settings - Fork 56
fix: Resolve docker-dev build failures for arm64 and macOS #641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ upstream-sync: | |
| . ./venv/bin/activate && python cre.py --upstream_sync | ||
|
|
||
| dev-flask: | ||
| . ./venv/bin/activate && INSECURE_REQUESTS=1 FLASK_APP=`pwd`/cre.py FLASK_CONFIG=development flask run | ||
| . ./venv/bin/activate && INSECURE_REQUESTS=1 FLASK_APP=`pwd`/cre.py FLASK_CONFIG=development flask run --host=0.0.0.0 | ||
|
|
||
| e2e: | ||
| yarn build | ||
|
|
@@ -83,7 +83,7 @@ docker-prod: | |
| docker build -f Dockerfile -t opencre:$(shell git rev-parse HEAD) . | ||
|
|
||
| docker-dev-run: | ||
| docker run -it -p 5000:5000 opencre-dev:$(shell git rev-parse HEAD) | ||
| docker run -it -p 5001:5000 opencre-dev:$(shell git rev-parse HEAD) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why's this necessary?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On macOS, port This prevents Mapping the container’s 5000 to a different host port (5001) avoids the OS-level port conflict while keeping the container port unchanged. This change fixes the macOS dev experience without affecting Linux/WSL users. |
||
|
|
||
| docker-prod-run: | ||
| docker run -it -p 5000:5000 opencre:$(shell git rev-parse HEAD) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Host cannot be 0.0.0.0 this exposes your Dev server to the network. There's a reason it's localhost by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added
--host=0.0.0.0because when Flask runs inside Docker, binding only to127.0.0.1makes the server reachable exclusively from inside the container. Even with-p 5001:5000, the host can’t access the app (resulting inERR_CONNECTION_RESET), since Flask is not listening on the container’s external interface. Using0.0.0.0resolves that and makes the dev container usable on macOS and Linux.Thanks for pointing this out — I’ll revisit this and look for an approach that keeps the default local behavior secure while still allowing the Docker-based setup to function correctly. I’ll update the PR with a cleaner solution.