-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodejs.Dockerfile
48 lines (37 loc) · 1.44 KB
/
nodejs.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 ubuntu:20.04@sha256:8e5c4f0285ecbb4ead070431d29b576a530d3166df73ec44affc1cd27555141b
ARG DEBIAN_FRONTEND=noninteractive
ARG TARGETARCH
ARG NODE_VERSION
ARG X_URL=https://deb.nodesource.com/setup_$NODE_VERSION.x
ARG BUN_VERSION=v1.1.40
RUN apt update && \
apt install -y curl software-properties-common default-jre locales git unzip && \
useradd -d /home/container -m container
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
RUN curl -sL $X_URL | bash - && \
apt install -y nodejs g++ build-essential ffmpeg
RUN npm i -g pm2 pnpm
# Install yarn
RUN apt remove cmdtest
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt update && \
apt install yarn
# Install bun
RUN case ${TARGETARCH} in 'amd64') TARGET=linux-x64-baseline;; 'arm64') TARGET=linux-aarch64;; esac && \
echo "TARGETARCH=${TARGETARCH}" && \
echo "TARGET=$TARGET" && \
curl -fL -o bun.zip https://github.com/oven-sh/bun/releases/download/bun-${BUN_VERSION}/bun-$TARGET.zip && \
unzip bun.zip && \
mv bun-$TARGET/bun /usr/local/bin/bun && \
rm -r bun.zip bun-$TARGET
# Lib dependencies for puppeteer
RUN apt install -y libxdamage1 libgbm1
USER container
ENV USER container
ENV HOME /home/container
WORKDIR /home/container
COPY ./nodejs.entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]