-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (22 loc) · 944 Bytes
/
Dockerfile
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
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
WORKDIR /app
COPY pyproject.toml pyproject.toml
COPY uv.lock uv.lock
COPY titiler/ titiler/
COPY README.md README.md
COPY LICENSE LICENSE
RUN apt-get update && apt-get -y --no-install-recommends install libexpat1 && uv sync --frozen --extra uvicorn
ARG EARTHDATA_USERNAME
ARG EARTHDATA_PASSWORD
# Check if EARTHDATA_USERNAME and EARTHDATA_PASSWORD are provided
RUN if [ -z "$EARTHDATA_USERNAME" ] || [ -z "$EARTHDATA_PASSWORD" ]; then \
echo "Error: EARTHDATA_USERNAME and EARTHDATA_PASSWORD build args must be provided"; \
exit 1; \
fi && \
echo "machine urs.earthdata.nasa.gov\nlogin ${EARTHDATA_USERNAME}\npassword ${EARTHDATA_PASSWORD}" > ~/.netrc && \
unset EARTHDATA_USERNAME && \
unset EARTHDATA_PASSWORD
# http://www.uvicorn.org/settings/
ENV HOST 0.0.0.0
ENV PORT 80
CMD uv run uvicorn titiler.cmr.main:app --host ${HOST} --port ${PORT} --log-level debug --reload