-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
31 lines (22 loc) · 978 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
30
31
# build the libpostal-server binary separately
FROM pelias/libpostal_baseimage as builder
RUN apt-get update && apt-get install -y make pkg-config build-essential
# install Golang
ARG TARGETARCH
RUN wget -qO- "https://golang.org/dl/go1.21.0.linux-${TARGETARCH}.tar.gz" | tar -C /usr/local -xzf -
ENV GOROOT="/usr/local/go"
ENV GOPATH="$HOME/go"
ENV PATH="${PATH}:$GOROOT/bin:$GOPATH/bin"
# bring in and build project go code
WORKDIR /code/go-whosonfirst-libpostal
RUN git clone https://github.com/whosonfirst/go-whosonfirst-libpostal.git .
RUN GO111MODULE=off make bin
# start of main image
FROM pelias/libpostal_baseimage
COPY --from=builder /code/go-whosonfirst-libpostal/bin/wof-libpostal-server /bin/
RUN ldconfig
USER pelias
ENV PORT 4400
# set entrypoint to executable, ensuring the host is set so network requests will work
# additional parameters can be passed on the command line
ENTRYPOINT [ "/bin/wof-libpostal-server", "-host", "0.0.0.0", "-port", "4400" ]