-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
50 lines (41 loc) · 1.24 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
# NodeJS 18 setup modified from standard NodeJS bullseye-slim installation
# borrow Dockerfile from https://github.com/consbio/mbgl-renderer/blob/main/docker/Dockerfile
# https://github.com/maplibre/maplibre-native/discussions/1091
FROM ubuntu:22.04 as build
ENV DEBIAN_FRONTEND noninteractive
ENV NODE_VERSION=22
# https://github.com/maplibre/maplibre-native/tree/main/platform/linux#prerequisites
RUN apt-get update && apt-get install -y \
curl \
libcurl4-openssl-dev \
libglfw3-dev \
libuv1-dev \
libpng-dev \
libicu-dev \
libjpeg-turbo8-dev \
libwebp-dev \
clang \
cmake \
ccache \
ninja-build \
pkg-config \
xvfb \
x11-utils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN curl -Ls https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash && \
apt-get update && apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app/src
COPY package*.json ./
RUN npm install -g npm && npm ci
COPY . .
RUN npm run build && \
cp package*.json entrypoint.sh /app/src/build/ && \
npm ci --omit=dev --prefix /app/src/build && \
mv /app/src/build/* /app/. && \
rm -rf /app/src
WORKDIR /app
ENV DISPLAY=:99
EXPOSE 80
ENTRYPOINT [ "/app/entrypoint.sh" ]