forked from DenisCarriere/mbtiles-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (40 loc) · 1.34 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 mhart/alpine-node:10
MAINTAINER Denis Carriere <@DenisCarriere>
# Create app directory
RUN mkdir -p /src
WORKDIR /src
# Install app dependencies
COPY package.json /src/
COPY yarn.lock /src/
RUN yarn install --production
# Remove unused sqlite3-offline binaries
RUN /bin/mv \
node_modules/sqlite3-offline/binaries/sqlite3-linux/node-v64-linux-x64 \
node_modules/sqlite3-offline/binaries/node-v64-linux-x64 \
&& /bin/rm -rf \
node_modules/sqlite3-offline/binaries/sqlite3-darwin/* \
node_modules/sqlite3-offline/binaries/sqlite3-darwin/* \
node_modules/sqlite3-offline/binaries/sqlite3-linux/* \
&& /bin/mv \
node_modules/sqlite3-offline/binaries/node-v64-linux-x64 \
node_modules/sqlite3-offline/binaries/sqlite3-linux
# Smaller image
FROM mhart/alpine-node:slim-10
RUN mkdir -p /src
# Copy node_modules from previous layer
COPY --from=0 /src /src
WORKDIR /src
# Bundle app source
COPY . /src/
RUN mkdir -p /root/mbtiles
# Enables customized options using environment variables
ENV MBTILES_SERVER_CACHE='/root/mbtiles'
ENV MBTILES_SERVER_PROTOCOL='http'
ENV MBTILES_SERVER_DOMAIN='localhost'
ENV MBTILES_SERVER_PORT='5000'
ENV MBTILES_SERVER_SSL_KEY='/root/mbtiles/server.key'
ENV MBTILES_SERVER_SSL_CERT='/root/mbtiles/server.cert'
ENV MBTILES_SERVER_VERBOSE='true'
# Run App
EXPOSE 5000
CMD ["node", "./bin/mbtiles-server.js", "--verbose"]