Skip to content

Commit 3e67674

Browse files
committed
minor changes in readme
1 parent 4826f19 commit 3e67674

File tree

1 file changed

+22
-44
lines changed

1 file changed

+22
-44
lines changed

README.md

Lines changed: 22 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434

3535
## Installation and Running:
3636

37-
### **Method 1: Install via PyPI and Run with Docker Compose or Podman Compose**
37+
### **Method 1: Install via PyPI and Use Docker/Podman Compose for Backend**
3838

3939
#### **Prerequisites**
4040

4141
- [**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.
4242

4343
This approach is for users who want to install the Python package separately before running the app.
4444

45-
##### **Step 1: Install STAC-FastAPI**
45+
#### **Step 1: Install STAC-FastAPI**
4646

4747
- **For Elasticsearch backend:**
4848

@@ -56,7 +56,7 @@ This approach is for users who want to install the Python package separately bef
5656
pip install stac_fastapi.opensearch
5757
```
5858

59-
##### **Step 2: Start Elasticsearch/OpenSearch Backend**
59+
#### **Step 2: Start Elasticsearch/OpenSearch Backend**
6060

6161
Launch Elasticsearch using Docker Compose:
6262

@@ -67,7 +67,7 @@ docker-compose up -d elasticsearch
6767
docker-compose up -d opensearch
6868
```
6969

70-
##### **Step 3: Run the Application**
70+
#### **Step 3: Run the Application**
7171

7272
With Elasticsearch running, you can now run the application:
7373

@@ -104,85 +104,63 @@ Most recent Elasticsearch 7.x versions should also be compatible. For detailed c
104104

105105
- [**Docker**](https://docs.docker.com/get-started/) or [**Podman**](https://podman.io/docs) installed and running on your machine. In all the follwoing steps instead of `docker` you can use `podman` as well.
106106

107-
#### **Step 1: Create a `.env` File**
108-
109-
Configure your environment variables in a `.env` file. You can choose to connect to an external Elasticsearch/OpenSearch instance or run one locally within the container.
110-
111-
- **Option A: Connect to an External Instance**
112-
113-
```env
114-
ES_HOST=your_external_host
115-
ES_PORT=your_external_port
116-
ES_USE_SSL=false # Set to 'true' if SSL is used
117-
ES_VERIFY_CERTS=false # Set to 'true' to verify SSL certificates
118-
```
119-
120-
- **Option B: Running Locally Within the Container**
121-
122-
- **For Elasticsearch:**
123-
124-
```env
125-
RUN_LOCAL_ES=1
126-
```
127-
128-
- **For OpenSearch:**
129-
130-
```env
131-
RUN_LOCAL_OS=1
132-
```
133-
134-
> [!IMPORTANT]
135-
> The variables `RUN_LOCAL_ES` and `RUN_LOCAL_OS` correspond to **different Docker images**:
136-
> - Use `RUN_LOCAL_ES` with the `ghcr.io/stac-utils/stac-fastapi-es` image.
137-
> - Use `RUN_LOCAL_OS` with the `ghcr.io/stac-utils/stac-fastapi-os` image.
138-
139-
#### **Step 2: Run the Docker Container**
107+
> [!IMPORTANT]
108+
> The variables `RUN_LOCAL_ES` and `RUN_LOCAL_OS` correspond to **different Docker backend images**. By default, both are set to `0`, indicating that the backend systems are expected to run externally. In this case, you must configure the appropriate `ES_HOST` and `ES_PORT` environment variables to connect to the external Elasticsearch or OpenSearch instance. Alternatively, if you do not have an external backend and wish to run Elasticsearch or OpenSearch alongside the STAC-FastAPI within the container, set the respective variable to `1`:
109+
> - Use `RUN_LOCAL_ES` with the `ghcr.io/stac-utils/stac-fastapi-es` image.
110+
> - Use `RUN_LOCAL_OS` with the `ghcr.io/stac-utils/stac-fastapi-os` image.
140111
112+
#### **Step 1: Run the Docker Container**
113+
141114
- **For Elasticsearch Backend:**
142115

143116
- **Connecting to External Instance:**
144117

145118
```shell
146-
docker run -d -p 8080:8080 --env-file .env ghcr.io/stac-utils/stac-fastapi-es:latest
119+
docker run -d -p 8080:8080 -e ES_HOST=external_host -e ES_PORT=external_port ghcr.io/stac-utils/stac-fastapi-es:latest
147120
```
148121

149122
- **Running Locally:**
150123

151124
```shell
152-
docker run -d -p 8080:8080 -p 9200:9200 --env-file .env ghcr.io/stac-utils/stac-fastapi-es:latest
125+
docker run -d -p 8080:8080 -p 9200:9200 -e RUN_LOCAL_ES=1 ghcr.io/stac-utils/stac-fastapi-es:latest
153126
```
154127

155128
- **For OpenSearch Backend:**
156129

157130
- **Connecting to External Instance:**
158131

159132
```shell
160-
docker run -d -p 8080:8080 --env-file .env ghcr.io/stac-utils/stac-fastapi-os:latest
133+
docker run -d -p 8080:8080 -e ES_HOST=external_host -e ES_PORT=external_port ghcr.io/stac-utils/stac-fastapi-os:latest
161134
```
162135

163136
- **Running Locally:**
164137

165138
```shell
166-
docker run -d -p 8080:8080 -p 9202:9202 --env-file .env ghcr.io/stac-utils/stac-fastapi-os:latest
139+
docker run -d -p 8080:8080 -p 9202:9202 -e RUN_LOCAL_OS=1 ghcr.io/stac-utils/stac-fastapi-os:latest
167140
```
141+
> [!Note]
142+
> For external instances of both **Elasticsearch** and **OpenSearch**, configure the following
143+
> environment variables as needed:
144+
> - `-e ES_USE_SSL=false` — Set to `true` if SSL is enabled.
145+
> - `-e ES_VERIFY_CERTS=false` — Set to `true` to enable SSL certificate verification.
168146

169147
> [!TIP]
170148
> If you need to mount a volume, use the [`-v`](https://docs.docker.com/engine/storage/volumes/#choose-the--v-or---mount-flag) flag. To specify an environment file, use the [`--env-file`](https://docs.docker.com/reference/cli/docker/container/run/#env) flag.
171149

172150

173-
#### **Step 3: Verify and Access**
151+
#### **Step 2: Verify and Access**
174152

175153
- **Check if the container is running:**
176154

177155
```shell
178-
docker ps # "podman ps" if you are running via podman
156+
docker ps
179157
```
180158

181159
- **Access the API:**
182160

183161
Visit `http://localhost:8080` in your browser or use it as the base URL for API requests.
184162

185-
##### **Configuration reference keys:**
163+
#### **Configuration reference keys:**
186164

187165
You can customize additional settings in your `.env` file:
188166
###### Key variables to configure:

0 commit comments

Comments
 (0)