This repository was archived by the owner on Jan 4, 2023. It is now read-only.
forked from engineer-man/piston
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
57 lines (45 loc) · 2.17 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
FROM node:15.10.0-buster-slim AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg-reconfigure -p critical dash
RUN for i in $(seq 1001 1500); do \
groupadd -g $i runner$i && \
useradd -M runner$i -g $i -u $i ; \
done
RUN apt-get update && \
apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev \
binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev \
libncurses6 libncurses5 libedit-dev libseccomp-dev rename procps python3 \
libreadline-dev libblas-dev liblapack-dev libpcre3-dev libarpack2-dev \
libfftw3-dev libglpk-dev libqhull-dev libqrupdate-dev libsuitesparse-dev \
libsundials-dev && \
rm -rf /var/lib/apt/lists/*
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
FROM debian:buster-slim AS pkgbuild
ENV DEBIAN_FRONTEND noninteractive
# NOTE: Removed linux-headers-amd64
RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev \
pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev \
sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git \
perl xz-utils python3 python3-pip gnupg jq zlib1g-dev \
cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils \
util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev \
libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 libffi-dev gfortran\
libreadline-dev libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libfftw3-dev \
libglpk-dev libqhull-dev libqrupdate-dev libsuitesparse-dev libsundials-dev && \
ln -sf /bin/bash /bin/sh && \
rm -rf /var/lib/apt/lists/* && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
WORKDIR /piston/packages
COPY ./packages .
RUN make -j16 python-3.9.4.pkg.tar.gz
FROM base AS final
WORKDIR /piston_api
COPY ["./api/package.json", "./api/package-lock.json", "./"]
RUN npm install
COPY ./api/src ./src
RUN make -C ./src/nosocket/ all && make -C ./src/nosocket/ install
WORKDIR /piston/packages/python
COPY --from=pkgbuild /piston/packages/python .
WORKDIR /piston_api
CMD [ "node", "src"]
EXPOSE 2000/tcp