Skip to content

Docker Support for Issue Docker Support #85 #112

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 1 commit into
base: main
Choose a base branch
from

Conversation

SANTHOSH-SACHIN
Copy link

@SANTHOSH-SACHIN SANTHOSH-SACHIN commented Feb 22, 2025

Docker Support for Data Formulator

Overview

This PR adds comprehensive Docker support to Data Formulator, enabling easier deployment and development. The implementation includes multi-stage builds, environment variable management, and production-ready configurations.

Key Changes

  • Added multi-stage Dockerfile optimized for both development and production
  • Implemented docker-compose.yml for simplified deployment
  • Added docker-entrypoint.sh with production/development mode support
  • Enhanced environment variable handling for API keys and configuration
  • Updated documentation with Docker setup instructions

Features

  • Multi-stage Build: Optimized image size by separating frontend build from runtime
  • Environment Management: Flexible configuration through environment variables
  • Development Mode: Volume mounting for live code updates
  • Production Mode: Gunicorn support for production deployments
  • API Key Management: Secure handling of provider API keys

Documentation Updates

  • Added Docker deployment instructions to README.md
  • Created comprehensive DOCKER.md guide
  • Updated DEVELOPMENT.md with Docker workflow
  • Added configuration documentation

Related Files

  • Dockerfile
  • docker-compose.yml
  • docker-entrypoint.sh
  • DOCKER.md
  • Updated README.md and DEVELOPMENT.md

Dependencies

  • Python 3.12
  • Node.js 18
  • Required Python packages in requirements.txt
  • Frontend dependencies in package.json

Security Considerations

  • API keys managed through environment variables
  • No sensitive data in Docker images
  • Production-ready Gunicorn configuration
  • Proper permission handling in containers

Breaking Changes

None. This is an additive change that maintains backward compatibility with existing deployment methods.

Future Work

  • Container orchestration support (Kubernetes)
  • Additional deployment environment configurations
  • CI/CD pipeline integration
    @Chenglong-MS @danmarshall

@SANTHOSH-SACHIN
Copy link
Author

@microsoft-github-policy-service agree

@danmarshall
Copy link
Collaborator

Thanks for the PR, but we already have an existing PR for this: #90 . Would you mind looking at that one and let us know how this differs?

@Chenglong-MS Chenglong-MS requested a review from Copilot March 3, 2025 18:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR introduces Docker support for Data Formulator to simplify both development and production deployments. Key changes include:

  • A multi-stage Dockerfile and docker-compose.yml for streamlined container management.
  • New documentation in DOCKER.md and updates to README.md and DEVELOPMENT.md describing Docker deployment and development workflows.

Reviewed Changes

File Description
DOCKER.md Adds a complete Docker deployment guide outlining build, run, and configuration steps.
README.md Updates deployment instructions with code examples for Docker.
docker-compose.yml Introduces a Docker Compose configuration to simplify container orchestration.
DEVELOPMENT.md Updates local development instructions to include Docker-based workflows.

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


1. **Build the Docker image:**

```bash:README.md
Copy link
Preview

Copilot AI Mar 3, 2025

Choose a reason for hiding this comment

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

The code snippet marker incorrectly includes ':README.md'; this could affect markdown rendering. Please change it to '```bash' for proper syntax highlighting.

Suggested change
```bash:README.md
```bash

Copilot uses AI. Check for mistakes.

@SANTHOSH-SACHIN
Copy link
Author

SANTHOSH-SACHIN commented Mar 3, 2025

Thanks for the PR, but we already have an existing PR for this: #90 . Would you mind looking at that one and let us know how this differs?

I've implemented the streamlined Docker approach in this PR #85 based on several technical advantages that will improve performance, resource utilization, and deployment efficiency:

Optimized Multi-stage Build Pipeline:

  • This PR leverages a clean frontend-to-backend build pipeline that minimizes artifact transfer between stages
  • Reduced layer complexity results in more efficient Docker image caching

Reduced Container Size and Resource Footprint:

  • Final image contains only the compiled frontend assets and necessary backend code
  • Elimination of development dependencies in the production container (no Node.js runtime)
  • Smaller image size means faster deployments and reduced registry storage costs

Enhanced CI/CD Integration:

  • Single Dockerfile approach simplifies CI/CD pipeline configuration
  • Consistent build process across environments ensures deployment reliability
  • No conditional logic in the build process that could create environment-specific bugs

Runtime Performance Improvements:

  • Automatic production detection with Gunicorn implementation for superior request handling
  • On-demand installation of production dependencies only when needed
  • Direct volume mounting provides better I/O performance for active development

Centralized Environment Configuration:

  • All environment variables managed at the docker-compose level for better secrets management integration
  • Environment variable inheritance aligns with modern container orchestration practices

@danmarshall @Chenglong-MS

@Chenglong-MS
Copy link
Collaborator

I have briefly compared both PRs, mostly differs from how files are organized and options to deal with API keys etc. Though I currently have trouble work out either... so I'll try to look into what's the issues now.

@SANTHOSH-SACHIN
Copy link
Author

organized and options to deal with API keys etc

Sure .. If you need any help or clarification , reach out to me in this discussion

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.

3 participants