generated from developmentseed/eoapi-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
162 lines (157 loc) · 4.93 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
services:
# change to official image when available https://github.com/radiantearth/stac-browser/pull/386
stac-browser:
# build: https://github.com/radiantearth/stac-browser.git
# TODO: Rm when https://github.com/radiantearth/stac-browser/pull/461 is merged
build:
context: dockerfiles
dockerfile: Dockerfile.browser
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:8085:8085"
env_file:
- path: .env
required: false
- path: .stac-browser.env
required: false
depends_on:
- stac
- raster
- database
stac:
build:
context: .
dockerfile: dockerfiles/Dockerfile.stac
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:8081:8081"
environment:
- PYTHONUNBUFFERED=1
# Application
- POSTGRES_USER=username
- POSTGRES_PASS=password
- POSTGRES_DBNAME=postgis
- POSTGRES_HOST_READER=database
- POSTGRES_HOST_WRITER=database
- POSTGRES_PORT=5432
- DB_MIN_CONN_SIZE=1
- DB_MAX_CONN_SIZE=1
# - EOAPI_STAC_TITILER_ENDPOINT=raster
- EOAPI_STAC_TITILER_ENDPOINT=http://127.0.0.1:8082
# PgSTAC extensions
# - EOAPI_STAC_EXTENSIONS=["filter", "query", "sort", "fields", "pagination", "titiler", "transaction"] # defaults
# - EOAPI_STAC_CORS_METHODS='GET,POST,PUT,OPTIONS'
env_file:
- path: .env
required: false
- path: .stac.env
required: false
depends_on:
- database
command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && uvicorn eoapi.stac.app:app --host 0.0.0.0 --port 8081 --workers 1"
develop:
watch:
- action: sync+restart
path: ./runtimes/eoapi/stac/eoapi
target: /opt/bitnami/python/lib/python3.11/site-packages/eoapi
- action: rebuild
path: ./runtimes/eoapi/stac/pyproject.toml
volumes:
- ./dockerfiles/scripts:/tmp/scripts
raster:
# At the time of writing, rasterio wheels are not available for arm64 arch
# so we force the image to be built with linux/amd64
platform: linux/amd64
build:
context: .
dockerfile: dockerfiles/Dockerfile.raster
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:8082:8082"
environment:
- PYTHONUNBUFFERED=1
# Application
- POSTGRES_USER=username
- POSTGRES_PASS=password
- POSTGRES_DBNAME=postgis
- POSTGRES_HOST=database
- POSTGRES_PORT=5432
- DB_MIN_CONN_SIZE=1
- DB_MAX_CONN_SIZE=10
- CPL_TMPDIR=/tmp
- GDAL_CACHEMAX=75%
- GDAL_INGESTED_BYTES_AT_OPEN=32768
- GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR
- GDAL_HTTP_MERGE_CONSECUTIVE_RANGES=YES
- GDAL_HTTP_MULTIPLEX=YES
- GDAL_HTTP_VERSION=2
- VSI_CACHE=TRUE
- VSI_CACHE_SIZE=536870912
- MOSAIC_CONCURRENCY=1
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
env_file:
- path: .env
required: false
- path: .raster.env
required: false
depends_on:
- database
command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && uvicorn eoapi.raster.app:app --host 0.0.0.0 --port 8082 --workers 10"
develop:
watch:
- action: sync+restart
path: ./runtimes/eoapi/raster/eoapi
target: /opt/bitnami/python/lib/python3.11/site-packages/eoapi
- action: rebuild
path: ./runtimes/eoapi/raster/pyproject.toml
volumes:
- ./dockerfiles/scripts:/tmp/scripts
vector:
build:
context: .
dockerfile: dockerfiles/Dockerfile.vector
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:8083:8083"
environment:
- PYTHONUNBUFFERED=1
# Application
- POSTGRES_USER=username
- POSTGRES_PASS=password
- POSTGRES_DBNAME=postgis
- POSTGRES_HOST=database
- POSTGRES_PORT=5432
- DB_MIN_CONN_SIZE=1
- DB_MAX_CONN_SIZE=10
- EOAPI_VECTOR_DEBUG=TRUE
env_file:
- path: .env
required: false
- path: .vector.env
required: false
command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && uvicorn eoapi.vector.app:app --host 0.0.0.0 --port 8083 --workers 10"
develop:
watch:
- action: sync+restart
path: ./runtimes/eoapi/vector/eoapi
target: /opt/bitnami/python/lib/python3.11/site-packages/eoapi
- action: rebuild
path: ./runtimes/eoapi/vector/pyproject.toml
depends_on:
- database
volumes:
- ./dockerfiles/scripts:/tmp/scripts
database:
image: ghcr.io/stac-utils/pgstac:v0.9.2
environment:
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgis
- PGUSER=username
- PGPASSWORD=password
- PGDATABASE=postgis
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:5439:5432"
command: postgres -N 500
volumes:
- ./.pgdata:/var/lib/postgresql/data
networks:
default:
name: eoapi-network