-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
52 lines (44 loc) · 1.36 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
FROM buildpack-deps:jammy
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
WORKDIR /app
# Combine update, install and cleanup steps to reduce layer size
RUN apt-get update && apt-get install -y \
libcurl4-openssl-dev \
libglfw3-dev \
libuv1-dev \
libpng-dev \
libicu-dev \
libjpeg-turbo8-dev \
libwebp-dev \
xvfb \
x11-utils \
clang \
git \
cmake \
ccache \
ninja-build \
pkg-config \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY package*.json /app/
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION v20.11.0
# Install nvm, node, npm and cleanup in a single RUN to reduce layer size
RUN mkdir -p $NVM_DIR \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm use --delete-prefix $NODE_VERSION \
&& npm install \
&& nvm cache clear
ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/bin
ENV PATH $NODE_PATH:$PATH
ENV DISPLAY=:99.0
# Start Xvfb in the background
RUN start-stop-daemon --start --pidfile /tmp/xvfb.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset
COPY ./src/* /app/src/
COPY entrypoint.sh /app
COPY ./tests/ /app/tests/
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT [ "/app/entrypoint.sh" ]