-
Notifications
You must be signed in to change notification settings - Fork 670
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/docker support #90
base: dev
Are you sure you want to change the base?
Conversation
- Add Dockerfile for containerization - Add docker-compose.yml for easy deployment - Add docker-entrypoint.sh for container initialization - Add configuration templates and documentation - Support API key configuration through environment variables - Add comprehensive Docker setup instructions Fixes microsoft#85
microsoft#85) - Add development environment with hot-reloading - Support both development and production modes - Update documentation with Docker usage instructions - Add troubleshooting guides - Improve configuration options - Update DEVELOPMENT.md with Docker instructions Fixes microsoft#85
@microsoft-github-policy-service agree |
Thanks! Does it also work on Windows? I see a .sh file |
docker/Dockerfile
Outdated
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Node.js and yarn | ||
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why you use Node v18 here? How about using the more recent v20 (maintenance LTS) or v22 (active LTS)? https://nodejs.org/en/about/previous-releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating to v22
I tried running, I got this error: => [data-formulator-dev development 4/12] WORKDIR /app 0.2s
=> [data-formulator-dev development 5/12] RUN mkdir -p /app/config 0.5s
=> ERROR [data-formulator-dev development 6/12] COPY docker-entrypoint.sh /app/ 0.0s |
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.1.7 to 3.2.4. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](cure53/DOMPurify@3.1.7...3.2.4) --- updated-dependencies: - dependency-name: dompurify dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
add multi-table readme message
Dev: provide ability to set timeout options, and improved backend logging so that users can provide feedback
feat(docker): Update Docker configuration and add README documentation - Update Python from 3.11 to 3.12 in both development and production environments - Update Node.js from v18 to v22 - Fix docker-entrypoint.sh path in Dockerfile - Add preprocessing step to remove "-e ." from requirements.txt before installation - Add Docker section to main README.md with setup instructions for both development and production modes This update improves the Docker configuration with newer runtime versions and fixes path issues, while also making Docker support more visible to users through README documentation.
Addressed issue in recent change. successfully builds now. |
…rn/dompurify-3.2.4 Bump dompurify from 3.1.7 to 3.2.4
…ys-button Feature/toggle show keys button. If the deployment decides to disable show keys, then there is no option to show keys in the frontend.
There was a problem hiding this 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 adds Docker support to Data Formulator, enabling containerized development and production deployments for consistent environments.
- Added a comprehensive Docker README with quick start instructions and troubleshooting tips.
- Introduced a docker-compose.yml to define development and production services with appropriate environment settings and volume mounts.
- Expanded the existing DEVELOPMENT documentation with Docker build options.
Reviewed Changes
File | Description |
---|---|
docker/README.md | New documentation detailing Docker usage and configuration. |
README.md | Updated main README to include Docker as a deployment option. |
docker/docker-compose.yml | New file defining container services for development and production. |
DEVELOPMENT.md | Documentation updated with Docker build and run instructions. |
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
docker/docker-compose.yml
Outdated
dockerfile: docker/Dockerfile | ||
target: production | ||
ports: | ||
- "5000:5000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The production service port mapping in the docker-compose file ('5000:5000') does not match the custom port configuration example in docker/README.md ('8080:5000'). Consider aligning these for consistency.
- "5000:5000" | |
- "8080:5000" |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
I run into multiple issues trying to work with this docker setup:
|
- Align port mapping in docker-compose.yml with README.md example (5000:5000 → 8080:5000) - Fix entrypoint script path issue by adding explicit entrypoint configurations - Add network binding (--host 0.0.0.0) for better container accessibility - Resolves container startup errors and network access issues
Thanks for the quick fix! I still run into some issue:
|
# Docker Configuration Changes ## Fixed Issues - Fixed Python module import error by updating PYTHONPATH in docker-entrypoint.sh - Resolved conflict between docker-compose.yml command and entrypoint script - Added solution for Flask static files in development mode - Ensured proper frontend-backend connectivity in Docker environment ## Changes Made ### docker-entrypoint.sh 1. Updated PYTHONPATH to correctly include the py-src directory: ```bash export PYTHONPATH=$PYTHONPATH:/app/py-src ``` 2. Added code to create a simple index.html file in the Flask static directory: ```bash # Create dist directory if it doesn't exist mkdir -p /app/py-src/data_formulator/dist # Create a simple index.html file that redirects to the Vite dev server cat > /app/py-src/data_formulator/dist/index.html << 'EOF' <!DOCTYPE html> <html> <head> <meta http-equiv="refresh" content="0;URL='http://localhost:5173'" /> </head> <body> <p>Redirecting to development server...</p> </body> </html> EOF ``` 3. Updated the frontend server start command to include host option: ```bash yarn start --host 0.0.0.0 ``` ### docker-compose.yml 1. Removed the command override that was conflicting with the entrypoint script: ```yaml # Removed: command: sh -c "yarn && yarn start --host 0.0.0.0" ``` ### docker/README.md 1. Updated Development Mode section to clarify: - Frontend access at http://localhost:5173 - Backend API access at http://localhost:5001 - Both servers running in the same container 2. Added troubleshooting information for backend and frontend connection issues ## How It Works Now - The entrypoint script correctly sets up the Python environment - Both frontend (Vite) and backend (Flask) servers start properly - Frontend is accessible at http://localhost:5173 - Backend API is accessible at http://localhost:5001 - Flask serves a redirect page when accessed directly - Development mode with hot-reloading works as expected These changes ensure that the Docker development environment works correctly with both the frontend and backend components of Data Formulator.
You should now be able to run command "docker compose -f docker/docker-compose.yml down && docker compose -f docker/docker-compose.yml up --build data-formulator-dev" and see tool on port :5173 |
Can you do this PR to dev branch? I’ll still need to tweak some minor stuff there, especially for the data-formulator-dev
…________________________________
From: Donnivis Baker ***@***.***>
Sent: Monday, March 3, 2025 11:26:07 AM
To: microsoft/data-formulator ***@***.***>
Cc: Chenglong Wang ***@***.***>; Comment ***@***.***>
Subject: Re: [microsoft/data-formulator] Feature/docker support (PR #90)
Thanks for the quick fix! I still run into some issue:
1. entrypoint: [ "/bin/bash", "/app/docker/docker-entrypoint.sh" ] --> entrypoint: [ "/bin/bash", "/app/docker-entrypoint.sh" ] since it is copied as /app/docker-entrypoint.sh
2. still have issue routing 127.0.0.1 to my browser
You should now be able to run command "docker compose -f docker/docker-compose.yml down && docker compose -f docker/docker-compose.yml up --build data-formulator-dev" and see tool on port :5173
—
Reply to this email directly, view it on GitHub<#90 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWJXEPEQUGQ4VY47DHKEWI32SSUE7AVCNFSM6AAAAABXDTTYCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJVGM2DEMJUGY>.
You are receiving this because you commented.Message ID: ***@***.***>
[dbsectrainer]dbsectrainer left a comment (microsoft/data-formulator#90)<#90 (comment)>
Thanks for the quick fix! I still run into some issue:
1. entrypoint: [ "/bin/bash", "/app/docker/docker-entrypoint.sh" ] --> entrypoint: [ "/bin/bash", "/app/docker-entrypoint.sh" ] since it is copied as /app/docker-entrypoint.sh
2. still have issue routing 127.0.0.1 to my browser
You should now be able to run command "docker compose -f docker/docker-compose.yml down && docker compose -f docker/docker-compose.yml up --build data-formulator-dev" and see tool on port :5173
—
Reply to this email directly, view it on GitHub<#90 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWJXEPEQUGQ4VY47DHKEWI32SSUE7AVCNFSM6AAAAABXDTTYCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJVGM2DEMJUGY>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Updated PR branch to dev as requested
Updated PR branch as requested |
Fixes #85