Skip to content

fix: updated docker file to use lock file if it's present, if it's no… #34833

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

Open
wants to merge 2 commits into
base: release
Choose a base branch
from

Conversation

Naveen-Goud
Copy link
Contributor

@Naveen-Goud Naveen-Goud commented Jul 10, 2024

Description

this is the PR for the Isuue - #33743

Updates in Pr:

  • modified the dockerfile to copy package files and RUN based on lock file availability.
  • modified the ENTRYPOINT command , to resolve the path which is causing error during the build process.

Description about the chnaged code:
1.the new code main check for the lock file , if its present then it install the depencies from lock file
, if its not there then it install the dependecies through the package.json file.
the new code main deals with this also updated few lines to avoid the errors while generting the image
for the project.
2.EntryPoint is commentted and its written in the RUN along by providing the permission to the file
""chmod +x /deploy/docker/fs/entrypoint.sh "".
3.In Docker, it's a good practice to use /opt/bin as a directory to store custom binaries and scripts
that you want to include in your Docker image. This directory is then added to the PATH environment
variable, allowing the executables within it to be easily run from anywhere in the container.
In the code, I have used /opt instead of /opt/bin. There is not much difference between them, and it
does not cause any errors. Both /opt and /opt/bin are acceptable, but /opt/bin is commonly used for
rganizing custom executables.

I have tested it locally with appsmith project as well as other project containing lock file.It was working fine.

Below are the screenshots attached from build docker image to running the container and listing the files inside the image:

Screenshot from 2024-07-02 10-12-44
Screenshot from 2024-07-02 10-13-23
Screenshot from 2024-07-02 15-50-31

@srix @ayushpahwa

Summary by CodeRabbit

  • Chores
    • Improved Dockerfile structure and efficiency.
    • Updated directory creation, permission settings, and file copying processes.
    • Modified environment variables for better integration.
    • Adjusted health check command for more reliable performance.

…t then to use package.json to install dependencies.
Copy link
Contributor

coderabbitai bot commented Jul 10, 2024

Important

Review skipped

Auto reviews are limited to specific labels.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The Dockerfile changes focus on improving the structure and efficiency of the container setup process. Enhancements include streamlining the creation and management of directories, adjusting how files are copied and permissions are set, updating environment variables, and modifying the health check command to ensure better reliability and observability of the service.

Changes

File Change Summary
Dockerfile Restructured base stage, added directory creation, adjusted file copying, updated environment variables, modified health check command, and commented out ENTRYPOINT.

Poem

In the land of Docker's realm so fair,
Containers dream with structured care.
Directories bloom, permissions set,
Health checks now with more vignette.
Paths aligned, from start to end,
Efficiency climbs, our code's best friend! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 55b53a7 and 3b56626.

Files selected for processing (1)
  • Dockerfile (4 hunks)
Additional comments not posted (7)
Dockerfile (7)

3-3: LGTM! Explicitly naming the base stage improves clarity.

The base stage is explicitly named "base", which is a good practice for multi-stage builds.


16-16: LGTM! Creating necessary directories ensures smooth file operations.

The directories for plugins, editor, and RTS are created to ensure they exist before copying files into them.


18-19: LGTM! Copying necessary files ensures they are available in the container.

The JAR files, client UI, RTS, and package files are copied into the container to ensure they are available for the application.

Also applies to: 30-30


32-32: LGTM! Updating the PATH variable ensures correct directories are included.

The PATH environment variable is updated to include necessary directories.


36-42: LGTM! Conditional dependency installation ensures correct setup.

Dependencies are installed using yarn ci or yarn install based on the presence of package-lock.json, ensuring the correct setup.


44-47: LGTM! Additional setup and permissions ensure correct configuration.

Additional setup and permissions are configured for npm installation, script execution, and directory access.


59-60: LGTM! Health check and entry point command updates ensure correct management.

The health check command is updated to ensure correct monitoring, and the entry point command is commented out to manage it appropriately.

@Naveen-Goud
Copy link
Contributor Author

Hello @srix @ayushpahwa ,
I hope you're well. I’m curious and excited to hear your thoughts on my pull request raised a while ago. Looking forward to your review!

Thank you.

Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Jul 22, 2024
@Naveen-Goud
Copy link
Contributor Author

Hii @srix @ayushpahwa ,
Could you please review this PR.

thank you.

@github-actions github-actions bot removed the Stale label Jul 24, 2024
Copy link

github-actions bot commented Aug 2, 2024

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Aug 2, 2024
@Naveen-Goud
Copy link
Contributor Author

Hii @srix @ayushpahwa ,
Could you please review or assign reviewers to this PR.

thank you.

@Naveen-Goud
Copy link
Contributor Author

Hii @srix @ayushpahwa @Nikhil-Nandagopal @rohan-arthur ,
Could you please review or assign reviewers to this PR.

thank you.

@srix
Copy link
Contributor

srix commented Aug 22, 2024

I dont see my earlier comments resolved

@github-actions github-actions bot removed the Stale label Sep 1, 2024
Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants