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

add docker support #551

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

blairun
Copy link

@blairun blairun commented Aug 24, 2024

Add Docker support for web deployment

This pull request adds Docker support to easily deploy the Numbat web application. It includes a Dockerfile for building the application and a docker-compose.yaml for orchestrating the deployment.

Changes

New file: Dockerfile

Added a multi-stage Dockerfile that:

  1. Builds the WebAssembly package using Rust and wasm-pack.
  2. Sets up an Nginx server to host the built files.

New file: docker-compose.yaml

Added a docker-compose.yaml file that:

  1. Defines the service for the Numbat web application.
  2. Provides two options for building:
    a. From the local codebase
    b. Directly from the GitHub repository

How to use

To deploy the Numbat web application using Docker:

  1. Ensure Docker and Docker Compose are installed on your system.
  2. Navigate to the project root directory.
  3. Run docker-compose up --build to build and start the container.
  4. Access the application at http://localhost:8192.

Notes

  • The docker-compose.yaml file includes two build options. Uncomment the preferred option before running.
  • The application is exposed on port 8192. Adjust this in the docker-compose.yaml file if needed.

Testing

  • Verify that the Docker build process completes successfully.
  • Confirm that the web application is accessible and functioning correctly when deployed using Docker.
  • Test both build options in the docker-compose.yaml file.

@sharkdp
Copy link
Owner

sharkdp commented Aug 29, 2024

Thank you for your contribution.

This works fine, but I wonder if it's really necessary and for what exactly? Once built, Numbat is a static web application. It can be "deployed" by simply copying it to a server. During development, I just run python -m http.server to work with it (see https://github.com/sharkdp/numbat/blob/master/numbat-wasm/README.md).

@blairun
Copy link
Author

blairun commented Aug 31, 2024

Thanks for the feedback. Docker support is just meant as an alternative for those who prefer containerized deployments. I prefer deploying numbat this way for its isolation, portability, and ease of setup and maintenance. Of course, if you don't think it fits in the current scope of the project, I completely understand.

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.

2 participants