Skip to content

Conversation

robfrank
Copy link
Collaborator

This pull request includes updates to the Dockerfile and pom.xml to improve the base image, streamline user creation in the container, and refine dependency scopes.

Dockerfile updates:

  • Updated the base image in package/src/main/docker/Dockerfile from eclipse-temurin:21 to eclipse-temurin:21-alpine, which is smaller and more efficient.
  • Replaced useradd with adduser for creating the arcadedb user and added a command to upgrade Alpine packages, improving compatibility and security.
  • Added a blank line for clarity before the EXPOSE directive, enhancing readability.

Dependency scope refinement:

  • Set the scope of the json-path dependency to test in pom.xml, ensuring it is only included during testing and not in production builds.## Related issues

A list of issues either fixed, containing architectural discussions, otherwise relevant
for this Pull Request.

Additional Notes

#2316

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on optimizing the build process and resulting artifacts by transitioning the Docker image to a more lightweight Alpine-based Java runtime and refining the user setup within the container. Concurrently, it adjusts a Maven dependency's scope to ensure a library is only utilized during testing, thereby contributing to a more streamlined production build.

Highlights

  • Dockerfile Base Image Optimization: The base image for the Dockerfile (package/src/main/docker/Dockerfile) has been updated from eclipse-temurin:21 to the more compact and efficient eclipse-temurin:21-alpine variant, aiming for smaller image sizes and faster deployments.
  • Dockerfile User Setup and Package Management: The method for creating the arcadedb user in the Dockerfile has been changed from useradd to adduser -D -h /home/arcadedb -s /bin/sh arcadedb, which is more suitable for Alpine Linux. Additionally, a command apk -U upgrade was added to ensure all Alpine packages are up-to-date within the container.
  • Dockerfile Readability Improvement: A blank line was inserted before the EXPOSE directive in the Dockerfile to enhance its overall readability and structure.
  • Maven Dependency Scope Refinement: The json-path dependency in pom.xml has been explicitly scoped to test. This ensures that the dependency is only included during the testing phase and is excluded from production builds, contributing to a leaner final artifact.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request makes several good improvements. Switching to an Alpine-based Docker image is excellent for reducing image size. The user setup is now more idiomatic for Alpine, and updating packages is a good security measure. The dependency scope adjustment in pom.xml is also a great change to keep the production build lean. I have one suggestion for the Dockerfile to further optimize the image by merging RUN commands, which will reduce the number of layers.

Comment on lines +32 to +34
RUN apk -U upgrade && rm -rf /var/cache/apk/*

RUN adduser -D -h /home/arcadedb -s /bin/sh arcadedb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To optimize the Docker image and reduce the number of layers, it's a best practice to chain related RUN commands together. Combining the package upgrade and user creation into a single RUN instruction will result in a smaller and more efficient image layer.

RUN apk -U upgrade && rm -rf /var/cache/apk/* && adduser -D -h /home/arcadedb -s /bin/sh arcadedb

@robfrank robfrank merged commit b70abd2 into main Jun 30, 2025
13 of 17 checks passed
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-1.13%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (9451785) 70452 45118 64.04%
Head commit (c601456) 70452 (+0) 44320 (-798) 62.91% (-1.13%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2319) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

robfrank added a commit that referenced this pull request Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant