-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fix quickstart docker #835
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 WalkthroughWalkthroughThe pull request introduces significant changes to the Dockerfile used for building the application. The base image for the build stage is updated to Possibly related PRs
Suggested reviewers
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
docker/quickstart/Dockerfile (3)
Line range hint
5-13
: Optimize Docker layers by consolidating COPY commands.Multiple individual COPY commands for Cargo.toml files create unnecessary layers. Consider using a single COPY command with multiple source paths.
-COPY Cargo.toml /work/ -COPY Cargo.lock /work/ -COPY dynamic-proxy/Cargo.toml /work/dynamic-proxy/Cargo.toml -COPY plane/Cargo.toml /work/plane/Cargo.toml -COPY plane/plane-tests/plane-test-macro/Cargo.toml /work/plane/plane-tests/plane-test-macro/Cargo.toml -COPY plane/plane-tests/Cargo.toml /work/plane/plane-tests/Cargo.toml -COPY plane/plane-dynamic/Cargo.toml /work/plane/plane-dynamic/Cargo.toml +COPY Cargo.* /work/ +COPY dynamic-proxy/Cargo.toml plane/Cargo.toml plane/plane-tests/plane-test-macro/Cargo.toml plane/plane-tests/Cargo.toml plane/plane-dynamic/Cargo.toml ./
Line range hint
15-24
: Optimize Docker layers by consolidating directory creation commands.Multiple RUN commands for creating directories and empty files increase the image size unnecessarily. These operations can be combined into a single RUN command.
-RUN mkdir /work/plane/src -RUN echo "fn main() {}" > /work/plane/src/main.rs - -RUN mkdir -p /work/dynamic-proxy/src -RUN touch /work/dynamic-proxy/src/lib.rs - -RUN mkdir -p /work/plane/plane-tests/src -RUN mkdir -p /work/plane/plane-tests/plane-test-macro/src -RUN mkdir -p /work/plane/plane-dynamic/src -RUN touch /work/plane/plane-tests/plane-test-macro/src/lib.rs -RUN touch /work/plane/plane-tests/src/lib.rs -RUN touch /work/plane/plane-dynamic/src/lib.rs +RUN mkdir -p /work/plane/src \ + /work/dynamic-proxy/src \ + /work/plane/plane-tests/src \ + /work/plane/plane-tests/plane-test-macro/src \ + /work/plane/plane-dynamic/src && \ + echo "fn main() {}" > /work/plane/src/main.rs && \ + touch /work/dynamic-proxy/src/lib.rs \ + /work/plane/plane-tests/plane-test-macro/src/lib.rs \ + /work/plane/plane-tests/src/lib.rs \ + /work/plane/plane-dynamic/src/lib.rs
Line range hint
36-51
: Enhance security and container configuration.
- The container should run as non-root user for better security.
- Consider adding a health check for better container orchestration.
Add these improvements:
COPY --from=builder /work/target/release/plane /bin/plane COPY ./docker/quickstart/supervisord.conf /etc/supervisord.conf +USER plane + +HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ + CMD pg_isready -U plane || exit 1 + ENTRYPOINT ["supervisord", "-c", "/etc/supervisord.conf"]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- docker/quickstart/Dockerfile (1 hunks)
🧰 Additional context used
📓 Learnings (1)
docker/quickstart/Dockerfile (2)
Learnt from: paulgb PR: jamsocket/plane#819 File: docker/quickstart/Dockerfile:35-35 Timestamp: 2024-10-07T16:15:23.834Z Learning: In the `plane` project's Dockerfiles, `dynamic-proxy` is a library crate, not a binary.
Learnt from: paulgb PR: jamsocket/plane#819 File: docker/quickstart/Dockerfile:35-35 Timestamp: 2024-10-08T15:32:21.105Z Learning: In the `plane` project's Dockerfiles, `dynamic-proxy` is a library crate, not a binary.
🔇 Additional comments (1)
docker/quickstart/Dockerfile (1)
Line range hint
26-34
: Verify package name change and optimize build process.
- The package name has changed from
dynamic-proxy
toplane-dynamic-proxy
. This change needs verification.- The duplicate
cargo build
command forplane
package and the source file copying between builds might be inefficient.Consider optimizing the build process:
-RUN cargo build -p plane --release --locked -RUN cargo build -p plane-dynamic-proxy --release --locked - -COPY .cargo .cargo -COPY .git .git -COPY plane plane -COPY dynamic-proxy dynamic-proxy -RUN cargo build -p plane --release --locked +COPY .cargo .cargo +COPY .git .git +COPY plane plane +COPY dynamic-proxy dynamic-proxy +RUN cargo build -p plane -p plane-dynamic-proxy --release --locked
Same as #834, but for the quickstart dockerfile