This repository contains a simple Flask app that can be run using Docker Compose. Follow the instructions below to run the Flask app on your local machine.
- Flask
- Docker
- Postman or any other API testing tool
-
Clone the repository to your local machine.
-
Open a terminal and navigate to the project directory.
-
Run the following command to build and run the Docker containers:
python app.py
-
Clone the repository to your local machine.
-
Open a terminal and navigate to the project directory.
-
Run the following command to build and run the Docker containers:
docker-compose up --build
Once the containers are up and running, the Flask app will be accessible at http://localhost:5002/predict. or http://127.0.0.1:5002/predict by postman
-
Open Postman or any other API testing tool.
-
Create a POST request to http://localhost:5002/predict.
-
Set the request header Content-Type to application/json.
-
Set the request body to a JSON object with the required data. For example:
{ "month": 1 }
-
Send the request and observe the response from the Flask app.
To stop the containers, press Ctrl + C
in the terminal where the containers are running. Then, run the following
command:
docker-compose down