forked from maptiler/tileserver-gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
105 lines (86 loc) · 2.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
FROM ubuntu:focal AS builder
ENV NODE_ENV="production"
RUN set -ex; \
export DEBIAN_FRONTEND=noninteractive; \
apt-get -qq update; \
apt-get -y --no-install-recommends install \
build-essential \
ca-certificates \
wget \
pkg-config \
xvfb \
libglfw3-dev \
libuv1-dev \
libjpeg-turbo8 \
libicu66 \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
gir1.2-rsvg-2.0 \
librsvg2-2 \
librsvg2-common \
libcurl4-openssl-dev \
libpixman-1-dev \
libpixman-1-0; \
apt-get -y --purge autoremove; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*;
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN wget -qO- https://deb.nodesource.com/setup_18.x | bash; \
apt-get install -y nodejs; \
npm i -g npm@latest; \
apt-get -y remove wget; \
apt-get -y --purge autoremove; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*;
RUN mkdir -p /usr/src/app
COPY package* /usr/src/app
WORKDIR /usr/src/app
RUN npm install --omit=dev
FROM ubuntu:focal AS final
ENV \
NODE_ENV="production" \
CHOKIDAR_USEPOLLING=1 \
CHOKIDAR_INTERVAL=500
RUN set -ex; \
export DEBIAN_FRONTEND=noninteractive; \
groupadd -r node; \
useradd -r -g node node; \
apt-get -qq update; \
apt-get -y --no-install-recommends install \
ca-certificates \
wget \
xvfb \
libglfw3 \
libuv1 \
libjpeg-turbo8 \
libicu66 \
libcairo2 \
libgif7 \
libopengl0 \
libpixman-1-0 \
libcurl4 \
librsvg2-2 \
libpango-1.0-0; \
apt-get -y --purge autoremove; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*;
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN wget -qO- https://deb.nodesource.com/setup_18.x | bash; \
apt-get install -y nodejs; \
npm i -g npm@latest; \
apt-get -y remove wget; \
apt-get -y --purge autoremove; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*;
COPY --from=builder /usr/src/app /usr/src/app
COPY . /usr/src/app
RUN mkdir -p /data && chown node:node /data
VOLUME /data
WORKDIR /data
EXPOSE 8080
USER node:node
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
HEALTHCHECK CMD node /usr/src/app/src/healthcheck.js