Skip to content

Commit 7664578

Browse files
committed
add titiler-xarray docker
1 parent 3e8d4c6 commit 7664578

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
## 0.22.2 (2025-06-02)
56

67
### titiler.application
78

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,14 @@ services:
6767
depends_on:
6868
- nginx-titiler
6969
command: ["nginx-debug", "-g", "daemon off;"]
70+
71+
titiler-xarray:
72+
extends:
73+
service: titiler
74+
platform: linux/amd64
75+
build:
76+
context: .
77+
dockerfile: dockerfiles/Dockerfile.xarray
78+
ports:
79+
- "8082:8082"
80+
command: ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8082", "--workers", "1"]

dockerfiles/Dockerfile.xarray

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG PYTHON_VERSION=3.12
2+
3+
FROM bitnami/python:${PYTHON_VERSION}
4+
RUN apt update && apt upgrade -y \
5+
&& apt install curl -y \
6+
&& rm -rf /var/lib/apt/lists/*
7+
8+
RUN python -m pip install -U pip
9+
RUN python -m pip install uvicorn uvicorn-worker gunicorn
10+
11+
COPY src/titiler/ /tmp/titiler/
12+
RUN python -m pip install /tmp/titiler/core "/tmp/titiler/xarray[full]" starlette-cramjam --no-cache-dir --upgrade
13+
RUN rm -rf /tmp/titiler
14+
15+
COPY src/titiler/xarray/examples/main.py app.py
16+
17+
###################################################
18+
# For compatibility (might be removed at one point)
19+
ENV MODULE_NAME=app
20+
ENV VARIABLE_NAME=app
21+
ENV HOST=0.0.0.0
22+
ENV PORT=80
23+
ENV WEB_CONCURRENCY=1
24+
CMD gunicorn -k uvicorn.workers.UvicornWorker ${MODULE_NAME}:${VARIABLE_NAME} --bind ${HOST}:${PORT} --workers ${WEB_CONCURRENCY}

0 commit comments

Comments
 (0)