-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
63 lines (40 loc) · 2.04 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
# use the x86-64 platform since the x86-64 version of Node.js is used
FROM --platform=linux/amd64 golang:1.22
# install unzip and xz-utils so that the downloaded content can be extracted
RUN apt-get update && apt-get install unzip xz-utils
##################################### install Node.js ##############################################
WORKDIR /app
RUN wget https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz
RUN tar -xf node-v20.11.0-linux-x64.tar.xz
ENV PATH="${PATH}:/app/node-v20.11.0-linux-x64/bin"
######################################### install yarn #############################################
RUN npm install --global yarn
########################################## install mlg #############################################
WORKDIR /app
# the commit SHA in https://github.com/mathlingua/mathlingua to use
ARG MATHLINGUA_SHA=ea200b65a41e2f9df44003d05aee8845de828a88
RUN wget https://github.com/mathlingua/mathlingua/archive/${MATHLINGUA_SHA}.zip
RUN unzip ${MATHLINGUA_SHA}.zip
RUN mv mathlingua-${MATHLINGUA_SHA} mathlingua
WORKDIR /app/mathlingua/web
# install the UI dependencies
RUN yarn install
WORKDIR /app/mathlingua
RUN make all
RUN chmod +x ./bin/mlg
ENV PATH="${PATH}:/app/mathlingua/bin"
################################### download the Mathlore content ##################################
WORKDIR /app
# the commit SHA in https://github.com/mathlingua/mathlore-content
# of the content to use
ARG MATHLORE_SHA=ad0f11db98450db6d10f6c7dc9221f5a5276f312
# download and extract the Mathlore content
RUN wget https://github.com/mathlingua/mathlore-content/archive/${MATHLORE_SHA}.zip
RUN unzip ${MATHLORE_SHA}.zip
# the mathlore-content-${MATHLORE_SHA} directory needs to be renamed to mathlore-content
# because the MATHLORE_SHA variable is available at build time but not run time
RUN mv mathlore-content-${MATHLORE_SHA} mathlore-content
####################################################################################################
WORKDIR /app/mathlore-content
# start the server
CMD cd /app/mathlore-content && mlg view