-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (56 loc) · 2.66 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
ARG BASE_OS="ubuntu:23.04"
FROM ${BASE_OS}
ENV BASE=/home/explodejs
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]
RUN apt-get update && \
apt-get install -y wget curl git unzip python3 python3-pip ca-certificates gnupg libgmp-dev graphviz sudo neovim && \
echo "/usr/local/bin" | bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)" && \
pip install --break-system-packages --upgrade pip setuptools
# Install Node.js
RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_21.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt update \
&& apt install nodejs -y
# Install Neo4j
ENV NEO4J_HOME="/var/lib/neo4j"
RUN wget -O - https://debian.neo4j.com/neotechnology.gpg.key | apt-key add - && \
echo 'deb https://debian.neo4j.com stable 5' | tee -a /etc/apt/sources.list.d/neo4j.list && \
apt-get update && \
apt-get install -y neo4j=1:5.9.0 && \
echo dbms.security.auth_enabled=false >> /etc/neo4j/neo4j.conf && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
chown -R neo4j:neo4j /var/lib/neo4j && \
chown -R neo4j:neo4j /var/log/neo4j && \
chmod -R g+rw /var/lib/neo4j && \
chmod -R g+rw /var/log/neo4j
# Configure 'explodejs' user
RUN useradd -ms /bin/bash explodejs && \
usermod -aG neo4j explodejs && \
echo explodejs:explodejs | chpasswd && \
cp /etc/sudoers /etc/sudoers.bak && \
echo "explodejs ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
echo "umask 000" >> ${BASE}/.bash_profile && \
echo "source ${BASE}/.bash_profile" >> ${BASE}/.bashrc && \
chown explodejs:explodejs ${BASE}/.bash_profile && \
chown explodejs:explodejs ${BASE}/.bashrc
USER explodejs
WORKDIR /home/explodejs
# Build graphjs and emca-sl
COPY --chown=explodejs:explodejs . /home/explodejs/explode-js
RUN opam init --disable-sandboxing --shell-setup -y \
&& opam switch create -y ecma-sl 5.2.0 \
&& eval $(opam env --switch=ecma-sl) \
&& opam update \
&& echo "eval \$(opam env --switch=ecma-sl)" >> ~/.bash_profile
RUN cd "${BASE}/explode-js/vendor/graphjs" \
&& sudo pip install --break-system-packages -r ./requirements.txt \
&& cd ./parser && sudo npm install && tsc
RUN cd "${BASE}/explode-js/" && eval $(opam env --switch=ecma-sl) \
&& sudo apt update \
&& opam install -y ./vendor/ECMA-SL --confirm-level=unsafe-yes \
&& opam install -y . --deps-only --confirm-level=unsafe-yes \
&& dune build \
&& dune install