Skip to content
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

docker compose overlay file for editable frontend container #1092

Merged
merged 7 commits into from
Feb 23, 2024
Merged

Conversation

jbirddog
Copy link
Contributor

@jbirddog jbirddog commented Feb 22, 2024

This provides an overlay file which when used along with the existing docker-compose.yml, allows for editing frontend code. Plan to add another overlay for the backend, and one for arena for running ./bin/run_pyl so one can spin up a local dev environment based on the docker containers. Added a Makefile to manage the docker compose commands since setting/reusing variables across commands is easy.

Summary by CodeRabbit

  • New Features
    • Enhanced development environment with setup commands, server controls, and linting capabilities.
    • Added Docker support for simplified application deployment.
  • Chores
    • Implemented Node.js environment in Docker for streamlined development and testing processes.

Copy link
Contributor

coderabbitai bot commented Feb 22, 2024

Walkthrough

Walkthrough

The changes streamline the development environment and deployment process for spiffworkflow-frontend. Developers can now easily set up their environment, manage the server, and deploy the application in a Docker container. These updates enhance efficiency and consistency in the development workflow.

Changes

Files Change Summary
Makefile, spiffworkflow-frontend/package.json Introduced Makefile targets for environment setup, server control, linting fixes, and shell access. Added docker:start script for Docker environment.
spiffworkflow-frontend/dev.Dockerfile, dev.docker-compose.yml Implemented Docker setup with Node.js environment, npm dependency installation, and application launch within a container.

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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.

Review Status

Actionable comments generated: 2

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 666b653 and 3ba2647.
Files selected for processing (4)
  • Makefile (1 hunks)
  • spiffworkflow-frontend/dev.Dockerfile (1 hunks)
  • spiffworkflow-frontend/dev.docker-compose.yml (1 hunks)
  • spiffworkflow-frontend/package.json (1 hunks)
Additional comments: 6
spiffworkflow-frontend/dev.Dockerfile (2)
  • 1-1: Using a specific version of the Node.js Docker image (20.8.1-bookworm-slim) is good practice for ensuring consistency across development environments. However, consider periodically reviewing and updating the Node.js version to benefit from security patches, performance improvements, and new features.
  • 9-9: The CMD directive specifies the command to run the application using npm run docker:start. This approach is clear and aligns with the PR's objective to streamline the development process. Ensure that the docker:start script in package.json is correctly configured to start the application in a development-friendly manner (e.g., enabling hot reloading).
spiffworkflow-frontend/dev.docker-compose.yml (1)
  • 1-10: The service configuration for spiffworkflow-frontend is well-defined, with clear settings for the build context, Dockerfile, environment variables, and volume mount. Using environment variables for configuration (HOST and PORT) and a volume mount for live editing are particularly beneficial for a development environment. Ensure that the SPIFFWORKFLOW_FRONTEND_PORT environment variable is documented and set in an appropriate place (e.g., .env file or Makefile) for clarity and ease of use.
Makefile (2)
  • 4-17: The Makefile targets for managing the development environment (dev-env, start-dev, stop-dev) are well-structured and use Docker Compose commands effectively. These targets simplify the process of building, starting, and stopping the development environment, aligning with the PR's objectives. Ensure that the docker-compose.yml file and the FRONTEND_DEV_OVERLAY variable are correctly configured and documented for these commands to work as expected.
  • 19-23: The fe-lint-fix and fe-sh targets provide convenient shortcuts for running lint fixes and accessing a shell within the frontend container, respectively. These additions enhance the development workflow by making common tasks more accessible. Ensure that the FRONTEND_CONTAINER variable matches the container name defined in the Docker Compose configuration to avoid any discrepancies.
spiffworkflow-frontend/package.json (1)
  • 69-69: The addition of the docker:start script in package.json is a key part of the PR's enhancements to the development environment. This script simplifies the process of starting the application within the Docker container. Ensure that the script's command (ESLINT_NO_DEV_ERRORS=true craco start) is correctly configured for the intended development workflow, particularly in terms of handling ESLint errors and starting the application.

spiffworkflow-frontend/dev.Dockerfile Outdated Show resolved Hide resolved
spiffworkflow-frontend/dev.Dockerfile Show resolved Hide resolved
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.

Review Status

Actionable comments generated: 0

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 3ba2647 and c978e7c.
Files selected for processing (1)
  • spiffworkflow-frontend/dev.Dockerfile (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • spiffworkflow-frontend/dev.Dockerfile

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.

Review Status

Actionable comments generated: 0

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between c978e7c and 520340b.
Files selected for processing (1)
  • spiffworkflow-frontend/package.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • spiffworkflow-frontend/package.json

@jbirddog jbirddog merged commit 718d27c into main Feb 23, 2024
22 checks passed
@jbirddog jbirddog deleted the dev_fe branch February 23, 2024 00:31
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.

None yet

2 participants