-
Notifications
You must be signed in to change notification settings - Fork 31
/
Dockerfile
48 lines (36 loc) · 947 Bytes
/
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 node:20.4.0-bookworm as builder
ARG ENABLE_LOGGING=ON
ENV ENABLE_LOGGING ${ENABLE_LOGGING}
# Install tools and dependencies
RUN apt update && apt install -y \
cmake \
ninja-build \
libboost-dev \
libboost-regex-dev \
libyaml-cpp-dev \
libleveldb-dev \
libmarisa-dev \
libopencc-dev
# Set up Emscripten
RUN git clone https://github.com/emscripten-core/emsdk.git && \
cd emsdk && \
./emsdk install latest && \
./emsdk activate latest
COPY / /my_rime
WORKDIR /my_rime
# Install pnpm and dev dependencies
RUN npm i -g pnpm && \
pnpm i
# Get submodules and font
RUN pnpm run submodule && \
pnpm run font
# Build WASM
RUN export PATH="$PATH:/emsdk/upstream/emscripten" && \
pnpm run native && \
pnpm run schema && \
pnpm run lib && \
pnpm run wasm
# Build webapp
RUN pnpm run build
FROM nginx:1.25.1-alpine-slim
COPY --from=builder /my_rime/dist /usr/share/nginx/html