-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/codespaces setup #1
Merged
Merged
Conversation
This file contains 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
Set up the development environment for the using GitHub Codespaces. This includes defining a devcontainer.json with a pre-configured universal image and necessary VS Code extensions to streamline development. The configuration automatically forwards port 8080 and sets the post-create command to start the Spring Boot server using Maven.
Devbox shell, remove extensions Removing extensions. Changed post-create command to install Devbox, clone the git repo, change repo, enter devbox shell
This Dockerfile configures a Devbox-based development environment. It includes commands to set up necessary directories, copy configuration files, install packages, and clone the repository. Finally, it runs the Spring Boot application using Maven.
Switch from a pre-built image to building from a Dockerfile. This change allows for more customization and better alignment with project-specific dependencies. Also, update the `remoteUser` to use a dynamic environment variable.
Relocated the Dockerfile to the .devcontainer directory.
Replaces the single CMD instruction with two separate commands: one to open the devbox shell and another to run the Spring Boot application server. This enhances modularity and ensures clean execution of each step.
Changed the Dockerfile path to point to root directory to ensure the correct Dockerfile is used during the build process.
Added the DEVBOX_USER environment variable to the Dockerfile to specify the default user as 'devbox-user'. This change ensures consistency and proper configuration for user-specific operations in the container.
Create a new 'devbox-user' and set up appropriate directory permissions.
Changed the remoteUser field from a variable to a hardcoded string to ensure consistency across different development environments.
Removed unnecessary user creation and environment variable settings to reduce complexity. Preserved essential commands to maintain functionality and ensure the proper setup of the working directory and package installations. CMD at the end of the script is deleted and will be moved to devcontainer.json.
Changed the remote user from 'devbox-user' to 'devbox'. Added a post-start command to initialize the Devbox environment and run the Spring Boot application using Maven.
This commit introduces two new aliases to the devbox.json file: "start" and "stop". These scripts utilize Maven commands to manage the spring-boot application lifecycle, allowing developers to easily start and stop the application.
… run Simplify the post-start command by replacing the existing bash script with `devbox run start`.
Updated the postCreateCommand in devcontainer.json to trigger mvn compile within the isolated environment.
- Changed the base image from Devbox to Ubuntu 24.04 - Install necessary tools (curl, ca-certificates) for a minimal setup. - Use Determinate Systems Nix installer for secure and reliable Nix installation. - Set up PATH to include Nix binaries. - Install Devbox using Nix
Created a non-root user and group for better security. Updated the Dockerfile to switch to this user after installation.
Redefined the installation by setting DEBIAN_FRONTEND to noninteractive. https://manpages.debian.org/testing/debconf-doc/debconf.7.en.html#DEBIAN_FRONTEND
Introduce a new endpoint that redirects requests from the root URL to the /greeting endpoint using RedirectView. This ensures users are automatically taken to the greeting page when accessing the root URL.
This change simplifies the Dockerfile by removing the creation of a non-root user and the subsequent user switch. This adjustment ensures that the focus remains on installing Devbox using Nix.
Add EXPOSE directive in the Dockerfile to allow the container to handle requests on port 8080. This change supports the functionality of the web server running inside the container.
Deleted the method that redirected from root endpoint to the greeting endpoint. Instead, visitors should see a landing page when accessing the base URL.
Removing this command, because the web server started successfully but then exited with 0 after completion and therefore got shut down. We'll let users start the server by themselves.
Enhance README.md with detailed steps for running the project using GitHub Codespaces. Users now have an alternative option to develop and run the application directly from a cloud-based development environment.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This pull request adds funtionality to enhance the Spring Boot Devbox Isolated Environment Demo, utilizing GitHub Codespaces. Devcontainer is configured to serve solely as an IDE, enhancing accessibility and portability for cloud-native development, without taking over dependency management which remains efficiently handled by Devbox. This setup demonstrates how Devbox and development containers can work together seamlessly, showcasing the project in a cloud-enabled environment or also running locally. The integration highlights development containers role in facilitating development online or locally using VS Code, while Devbox continues to manage all dependencies, ensuring that the environment remains robust and consistent.
Purpose and Scope of Changes
Key Changes
Custom Dockerfile:
curl
andca-certificates
installed, ensuring a minimal footprint by managing package installations and cleanups effectively.Devcontainer Configuration (
devcontainer.json
):devcontainer.json
setup can be used to configure a consistent development environment locally within Visual Studio Code.Static HTML Landing Page (
index.html
):/greeting
endpoint for API testing, and a reference to the GitHub repository for detailed project insights.README.md Updates:
README.md
to include detailed instructions for using GitHub Codespaces, starting the web server, and navigating the project.Identified Issues
Next Steps
root
user within the container.Documentation Enhancements
README.md
: Revised to provide clear instructions to guide new users through using Codespaces and understanding the integration with Devbox, making the initial setup and subsequent development tasks straightforward and intuitive.