rslim087/shipping-and-handling
This Docker image provides a microservice for calculating shipping fees based on product categories and time of day. It also provides a shipping explanation and returns all shipping fees for products.
In version 2.0.0, the Shipping and Handling Microservice has been updated to include MongoDB integration. It now relies on environment variables to establish a connection with a MongoDB database for storing and retrieving product data.
docker run -p 8080:8080 -e MONGO_URI=<mongo_uri> shipping-and-handling
To run a container from this image, use the following command:
docker run -p 8080:8080 shipping-and-handling
The microservice will be accessible at http://localhost:8080
.
GET /shipping-fee?product_id=<product_id>
: Calculates the shipping fee for a product based on its ID.GET /shipping-explanation
: Provides a sophisticated explanation of the shipping fee calculation.GET /all-shipping-fees
: Returns all shipping fees for products.This microservice does not require any environment variables to be set.
This microservice does not use any volumes.
To enable communication between the Shipping and Handling microservice and other microservices or applications, ensure that the containers are connected to the same Docker network. You can achieve this by following these steps:
docker network create my-network
--network
flag:docker run --network my-network -p 8080:8080 shipping-and-handling
docker run --network my-network -p 4000:4000 ecommerce-ui
By connecting the containers to the same Docker network, they can communicate with each other using their container names as hostnames.
If you want to build the Docker image yourself, follow these steps:
docker build -t shipping-and-handling .
This command will build the Docker image using the provided Dockerfile and tag it as shipping-and-handling
.
If you would like to contribute to this project, please follow the guidelines in the CONTRIBUTING.md file.
This project is licensed under the MIT License.
If you encounter any issues or have questions regarding this Docker image or the Shipping and Handling microservice, please open an issue on the GitHub repository.
docker pull rslim087/shipping-and-handling