forked from pelias/spatial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (36 loc) · 1.27 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
48
FROM missinglink/spatialite as spatialite
# --- base ---
FROM alpine:3.10 as base
COPY --from=spatialite /usr/lib/ /usr/lib
COPY --from=spatialite /usr/bin/ /usr/bin
COPY --from=spatialite /usr/share/proj/proj.db /usr/share/proj/proj.db
RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories
RUN apk update && \
apk --no-cache --update upgrade musl && \
apk add --upgrade --force-overwrite apk-tools@edge && \
apk add --update --force-overwrite gcc g++ musl-dev icu-dev icu-libs make sqlite python curl unzip jq nodejs npm && \
rm -rf /var/cache/apk/*
RUN spatialite ':memory:' 'SELECT sqlite_version()'
RUN spatialite ':memory:' 'SELECT spatialite_version()'
RUN sqlite3 :memory: 'SELECT load_extension("mod_spatialite")'
# create working dir
RUN mkdir /code /data
WORKDIR /code
# --- release ---
FROM base
WORKDIR /code
# configure npm
RUN npm set progress=false && npm config set depth 0
# prebuild amalgamation
COPY amalgamation /code/amalgamation
RUN npm i -g --unsafe better-sqlite3@latest --sqlite3=$PWD/amalgamation/sqlite-amalgamation-3280000
# preinstall dependencies
COPY package.json /code
RUN npm i --link
# copy source files
COPY . /code
RUN npm i --link
# run tests
RUN npm t
# entrypoint
ENTRYPOINT ["node", "bin/spatial.js"]