You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you for submitting the PR for the Docker configuration and Dockerfile updates.
Before merging, we performed a preliminary review and noticed a few areas that may affect container stability, runtime availability, and the build experience in certain network environments. Could you please take another look and make the necessary adjustments?
1. Docker Configuration
1.1 docker-entrypoint.sh: process startup behavior
In docker-entrypoint.sh, the current usage appears to combine exec uvicorn ... with &.
Since exec replaces the current process, while & runs a command in the background, using them together can lead to unexpected behavior. In practice, this may prevent the subsequent nginx startup command from being executed, causing the frontend service to be unavailable after the container starts.
Please consider revisiting the startup logic to ensure both uvicorn and nginx are started as expected.
1.2 Startup order between nginx and uvicorn
At the moment, nginx may start accepting requests before uvicorn has fully initialized.
During this short startup window, requests to /api/ may return 502 responses. It would be helpful to add a readiness check, wait mechanism, or another form of startup coordination to ensure the backend is ready before API traffic is routed to it.
1.3 Error handling for background processes
If uvicorn is started as a background process, set -e may not reliably catch failures from that process.
As a result, if uvicorn fails to start, the container may continue running silently. The frontend could still load normally, but all API requests would return 502, without a clear failure signal or container exit, making the issue difficult to troubleshoot.
Please consider adding proper process monitoring, error handling, or exit behavior so backend startup failures can be detected promptly.
2. Dockerfile
2.1 APT cache cleanup
The Dockerfile currently appears to run apt-get install without cleaning up the APT cache afterward.
While this does not affect functionality, it may unnecessarily increase the final image size. Please consider cleaning up files such as /var/lib/apt/lists/* after package installation.
2.2 EXPOSE 5173 in the production image
The Dockerfile currently includes EXPOSE 5173.
Since the production image serves the frontend through nginx on port 80, and 5173 is typically used by the Vite development server, exposing this port in the production Dockerfile may be misleading.
Please consider removing EXPOSE 5173 and exposing only the actual production service port.
3. Support for Configurable Package Mirrors
The current Dockerfile does not seem to provide configurable mirror support for pip or npm installation. In some network environments, especially where access to official registries is slow or unreliable, the build may fail due to timeouts.
To improve build reliability and flexibility, please consider adding --build-arg support for APT, pip, and npm mirrors, while keeping the official sources as the default values.
For example, the Dockerfile could support build arguments such as:
This would preserve the default behavior while allowing users to specify alternative mirrors when needed.
Overall, these items are mainly related to startup robustness, production image cleanliness, and build configurability. Please review and update the PR accordingly so we can continue moving it toward merge.
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
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.
add relevant files for Docker deployment and fix bugs in the front-end code