-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (30 loc) · 1.24 KB
/
Dockerfile
File metadata and controls
38 lines (30 loc) · 1.24 KB
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
FROM python:3.11-slim
# Install system dependencies for libpostal
RUN apt-get update && apt-get install -y \
build-essential curl automake autoconf libtool pkg-config git \
&& rm -rf /var/lib/apt/lists/*
# Build and install libpostal from source
RUN git clone https://github.com/openvenues/libpostal.git /tmp/libpostal \
&& cd /tmp/libpostal \
&& ./bootstrap.sh \
&& ./configure --datadir=/usr/local/share/libpostal \
&& make \
&& make install \
&& ldconfig \
&& rm -rf /tmp/libpostal
WORKDIR /app
ENV PYTHONUNBUFFERED=1
# Allow overriding install ref (defaults to main)
ARG RYANDATA_ADDR_UTILS_REF=main
# Install the package from git ref plus API deps
RUN pip install --no-cache-dir \
"git+https://github.com/Abstract-Data/RyanData-Address-Utils.git@${RYANDATA_ADDR_UTILS_REF}" \
fastapi \
"uvicorn[standard]" \
postal
# Optional: copy source for local development/mounting (no-op unless mounted)
COPY . /app
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 CMD curl -fsS http://localhost:8000/health || exit 1
# Default to serving the FastAPI app; override command for ad-hoc usage
CMD ["uvicorn", "ryandata_address_utils.api:app", "--host", "0.0.0.0", "--port", "8000"]