-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (36 loc) · 1.25 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# base image
FROM missinglink/gis
ENV DEBIAN_FRONTEND noninteractive
ENV LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
# dependencies
RUN apt-get update && apt-get install --no-install-recommends -y parallel jq curl && rm -rf /var/lib/apt/lists/*
# create app directory
RUN mkdir -p /usr/src/repos/wof-spatialite
WORKDIR /usr/src/repos/wof-spatialite
# data dirs
VOLUME "/in"
VOLUME "/out"
ENV INDIR "/in"
ENV OUTDIR "/out"
# set working dir
WORKDIR /usr/src/repos/wof-spatialite
# install golang
ENV GOPATH=/usr/src/.go
RUN wget -qO- https://dl.google.com/go/go1.10.linux-amd64.tar.gz | tar -C /usr/local -xzf -
RUN mkdir -p "${GOPATH}"
ENV PATH="${PATH}:/usr/local/go/bin:${GOPATH}/bin"
# golang modules
RUN go get github.com/shaxbee/go-spatialite
RUN go get github.com/mattn/go-sqlite3
# the go-sqlite3 package is broken on newer versions
RUN git -C "${GOPATH}/src/github.com/mattn/go-sqlite3" checkout '534c0213e2a3a8fd494c92a86fa6bb9ac3737269'
# set up server
COPY ./server.go /usr/src/repos/wof-spatialite
RUN go build server.go
# copy source code
COPY ./init.sql /usr/src/repos/wof-spatialite
COPY ./spatialite.sh /usr/src/repos/wof-spatialite
# copy demo files
COPY ./demo /usr/src/repos/wof-spatialite/demo
# set entry point
ENTRYPOINT [ "./spatialite.sh" ]