forked from krausest/js-framework-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (46 loc) · 1.57 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
FROM ubuntu:21.10
COPY install_rust.sh /root/
RUN echo "unsafe-perm = true" > /root/.npmrc
RUN echo "NG_CLI_ANALYTICS=ci" >> /root/.npmrc
RUN echo "{ \"allow_root\": true }" > /root/.bowerrc
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update
RUN apt-get install -y python3 m4 libtinfo5 libghc-zlib-dev rsync ghc haskell-stack curl g++ make git openjdk-8-jdk dos2unix python
ENV NVM_DIR /usr/local/nvm
RUN mkdir -p $NVM_DIR
ENV NODE_VERSION 16.15.1
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
# install node and npm
RUN source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
# add node and npm to path so the commands are available
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN mkdir /server
RUN mkdir /build
RUN mkdir /src
# Volume before chown changes owwner
VOLUME /src
VOLUME /build
COPY package.json /build
WORKDIR /build
# Install rust
RUN dos2unix /root/install_rust.sh
RUN bash /root/install_rust.sh
# Create server
COPY server /server
WORKDIR /server
RUN npm install
# USER user
RUN npm install
EXPOSE 8080
WORKDIR /build
CMD ["mkdir", "/build/frameworks"]
CMD ["mkdir", "/build/frameworks/keyed"]
CMD ["mkdir", "/build/frameworks/non-keyed"]
CMD ["/server/runserver-docker.sh"]
#CMD ["node","index.js"]