From e2839a6d7cfb1826fdbc084ce5bcc09776b58d6a Mon Sep 17 00:00:00 2001 From: lennyaiko Date: Thu, 27 Mar 2025 12:38:33 +0100 Subject: [PATCH] done --- README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/README.md b/README.md index e69de29..096cabb 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,75 @@ +# Flask API with Swagger in Docker + +This repository contains a Flask API with Swagger documentation, running inside Docker containers. + +## Getting Started + +### Prerequisites + +Ensure you have the following installed: + +- [Docker](https://www.docker.com/get-started) +- [Docker Compose](https://docs.docker.com/compose/install/) + +### Clone the Repository + +```sh +git clone +cd +``` + +### Setup and Run the Application + +#### 1. Build and Start the Containers + +```sh +docker-compose up --build -d +``` + +This will: + +- Build the Flask API container. +- Start the Swagger UI container separately. + +#### 2. Verify the Containers are Running + +```sh +docker ps +``` + +#### 3. Access the API + +- The **Flask API** will be available at: + ``` + http://localhost:5000 + ``` +- The **Swagger UI** will be available at: + ``` + http://localhost:9000 + ``` + You can interact with the API documentation and test endpoints from here. + +## Making API Requests + +You can send requests using tools like `curl` or Postman: + +```sh +curl -X GET http://localhost:5000/hello +``` + +## Stopping the Application + +To stop the running containers, use: + +```sh +docker-compose down +``` + +## Troubleshooting + +- If there are permission issues, try running Docker commands with `sudo`. +- If ports are in use, change them in `docker-compose.yml`. +- To rebuild the containers, use: + ```sh + docker-compose up --build -d + ```