You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-44Lines changed: 22 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,15 +34,15 @@
34
34
35
35
## Installation and Running:
36
36
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**
38
38
39
39
#### **Prerequisites**
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
43
This approach is for users who want to install the Python package separately before running the app.
44
44
45
-
#####**Step 1: Install STAC-FastAPI**
45
+
#### **Step 1: Install STAC-FastAPI**
46
46
47
47
-**For Elasticsearch backend:**
48
48
@@ -56,7 +56,7 @@ This approach is for users who want to install the Python package separately bef
@@ -67,7 +67,7 @@ docker-compose up -d elasticsearch
67
67
docker-compose up -d opensearch
68
68
```
69
69
70
-
#####**Step 3: Run the Application**
70
+
#### **Step 3: Run the Application**
71
71
72
72
With Elasticsearch running, you can now run the application:
73
73
@@ -104,85 +104,63 @@ Most recent Elasticsearch 7.x versions should also be compatible. For detailed c
104
104
105
105
-[**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.
106
106
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.
140
111
112
+
#### **Step 1: Run the Docker Container**
113
+
141
114
-**For Elasticsearch Backend:**
142
115
143
116
-**Connecting to External Instance:**
144
117
145
118
```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
147
120
```
148
121
149
122
- **Running Locally:**
150
123
151
124
```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
153
126
```
154
127
155
128
- **For OpenSearch Backend:**
156
129
157
130
- **Connecting to External Instance:**
158
131
159
132
```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
161
134
```
162
135
163
136
- **Running Locally:**
164
137
165
138
```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
167
140
```
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.
168
146
169
147
> [!TIP]
170
148
> 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.
171
149
172
150
173
-
#### **Step 3: Verify and Access**
151
+
#### **Step 2: Verify and Access**
174
152
175
153
- **Check if the container is running:**
176
154
177
155
```shell
178
-
docker ps # "podman ps" if you are running via podman
156
+
docker ps
179
157
```
180
158
181
159
- **Access the API:**
182
160
183
161
Visit `http://localhost:8080`in your browser or use it as the base URL for API requests.
184
162
185
-
#####**Configuration reference keys:**
163
+
#### **Configuration reference keys:**
186
164
187
165
You can customize additional settings in your `.env` file:
0 commit comments