|  | 
| 40 | 40 | 
 | 
| 41 | 41 | - [**Docker Compose**](https://docs.docker.com/compose/install/) or [**Podman Compose**](https://podman-desktop.io/docs/compose) installed and running on your machine. In all the follwoing steps instead of `docker-compose` you can use `podman-compose` as well. | 
| 42 | 42 | 
 | 
| 43 |  | -#### **Step 1: Install STAC-FastAPI** | 
|  | 43 | +This approach is for users who want to install the Python package separately before running the app. | 
| 44 | 44 | 
 | 
| 45 |  | -To install STAC-FastAPI with Elasticsearch or OpenSearch backend support, execute the following commands: | 
|  | 45 | +##### **Step 1: Install STAC-FastAPI** | 
| 46 | 46 | 
 | 
| 47 | 47 | - **For Elasticsearch backend:** | 
| 48 |  | - | 
|  | 48 | +   | 
| 49 | 49 |   ```bash | 
| 50 | 50 |   pip install stac_fastapi.elasticsearch | 
| 51 | 51 |   ``` | 
| 52 | 52 | 
 | 
| 53 | 53 | - **For OpenSearch backend:** | 
| 54 |  | - | 
|  | 54 | +   | 
| 55 | 55 |   ```bash | 
| 56 | 56 |   pip install stac_fastapi.opensearch | 
| 57 | 57 |   ``` | 
| 58 | 58 | 
 | 
| 59 |  | -#### **Step 2: Build the Elasticsearch API Backend** | 
|  | 59 | +##### **Step 2: Start Elasticsearch/OpenSearch Backend** | 
| 60 | 60 | 
 | 
| 61 |  | -Start the Elasticsearch service and build the STAC-FastAPI application image: | 
|  | 61 | +Launch Elasticsearch using Docker Compose: | 
| 62 | 62 | 
 | 
| 63 | 63 | ```bash | 
|  | 64 | +# For ElasticSearch | 
| 64 | 65 | docker-compose up -d elasticsearch | 
| 65 |  | -docker-compose build app-elasticsearch | 
|  | 66 | +# For OpenSearch | 
|  | 67 | +docker-compose up -d opensearch | 
| 66 | 68 | ``` | 
| 67 | 69 | 
 | 
| 68 |  | -#### **Step 3: Run the Elasticsearch API on `localhost:8080`** | 
|  | 70 | +##### **Step 3: Run the Application** | 
|  | 71 | + | 
|  | 72 | +With Elasticsearch running, you can now run the application: | 
|  | 73 | + | 
|  | 74 | +```bash | 
|  | 75 | +uvicorn stac_fastapi.elasticsearch.app:app \ | 
|  | 76 | +    --host localhost \ | 
|  | 77 | +    --port 8080 \ | 
|  | 78 | +    --workers 10 \ | 
|  | 79 | +    --reload | 
|  | 80 | +``` | 
| 69 | 81 | 
 | 
| 70 |  | -Launch the STAC-FastAPI application connected to Elasticsearch: | 
|  | 82 | +and with OpenSearch running: | 
| 71 | 83 | 
 | 
| 72 | 84 | ```bash | 
| 73 |  | -docker-compose up -d app-elasticsearch | 
|  | 85 | +uvicorn stac_fastapi.opensearch.app:app \ | 
|  | 86 | +    --host localhost \ | 
|  | 87 | +    --port 8080 \ | 
|  | 88 | +    --workers 10 \ | 
|  | 89 | +    --reload | 
| 74 | 90 | ``` | 
| 75 | 91 | 
 | 
| 76 | 92 | By default, Docker Compose uses Elasticsearch 8.x and OpenSearch 2.11.1. If you prefer to use different versions, create a file named `.env` in the same directory where you run Docker Compose and include the following lines: | 
|  | 
0 commit comments