Calculator
A simple, scientific calculator that runs in your browser.
Dependencies
This project can be run in a few different ways, and dependencies vary based on the method you choose.
- Browser Only: No dependencies, but the calculator will not be served from a webserver.
- Python: To serve the
index.htmlfile, you'll need Python installed. - Docker: To run the project in a container, you'll need Docker installed.
How to Run
Windows
- With Python: Run
start-server.bat. This will start a Python web server and open the calculator in your default browser. - With Docker: Run
run-docker.bat. This will use Docker Compose to build and run the container.
Linux / macOS
- With Python: Run
./start-server.sh. You may need to make it executable first withchmod +x start-server.sh. This will start a Python web server and open the calculator in your default browser. - With Docker: Run
./run-docker.sh. You may need to make it executable first withchmod +x run-docker.sh. This will use Docker Compose to build and run the container.
Server Setup
To deploy the calculator on a server, you only need Docker and Docker Compose installed. You do not need to clone this repository.
-
Install Docker and Docker Compose: Follow the official installation instructions for your server's operating system.
-
Create a
compose.yamlfile: On your server, create a new file namedcompose.yamland add the following content:services: web: image: gitea.easye.me/ejones/jack-calc:latest ports: - 8888:80 restart: unless-stopped -
Start the container: In the same directory where you created the
compose.yamlfile, run the following command:docker compose up -d
The -d flag runs the container in detached mode. The restart: unless-stopped policy ensures that the container will automatically restart if the server is rebooted.
The calculator will then be available at http://<your-server-ip>:8888.
Note on Firewalls: Ensure that your server's firewall is configured to allow incoming traffic on port 8888.