dockerfile updates to build on linux-arm

This commit is contained in:
Michael Nutt 2022-10-02 15:11:29 -04:00 committed by acalcutt
parent 7c0e0ed922
commit 86370651f1
2 changed files with 34 additions and 10 deletions

View file

@ -4,18 +4,35 @@ ENV NODE_ENV="production"
RUN set -ex; \ RUN set -ex; \
export DEBIAN_FRONTEND=noninteractive; \ export DEBIAN_FRONTEND=noninteractive; \
groupadd -r node; \
useradd -r -g node node; \
apt-get -qq update; \ apt-get -qq update; \
apt-get -y --no-install-recommends install \ apt-get -y --no-install-recommends install \
build-essential \
ca-certificates \ ca-certificates \
wget; \ wget \
pkg-config \
xvfb \
libglfw3-dev \
libuv1-dev \
libjpeg-turbo8 \
libicu66 \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
libcurl4-openssl-dev \
libpixman-1-dev; \
wget -qO- https://deb.nodesource.com/setup_16.x | bash; \ wget -qO- https://deb.nodesource.com/setup_16.x | bash; \
apt-get install -y nodejs; \ apt-get install -y nodejs; \
apt-get -y remove wget; \ apt-get -y remove wget; \
apt-get -y --purge autoremove; \ apt-get -y --purge autoremove; \
apt-get clean; \ apt-get clean; \
rm -rf /var/lib/apt/lists/*; rm -rf /var/lib/apt/lists/*;
COPY . /usr/src/app RUN mkdir -p /usr/src/app
COPY package.json package-lock.json /usr/src/app
RUN cd /usr/src/app && npm install --production RUN cd /usr/src/app && npm install --production
@ -34,13 +51,18 @@ RUN set -ex; \
apt-get -y --no-install-recommends install \ apt-get -y --no-install-recommends install \
ca-certificates \ ca-certificates \
wget \ wget \
pkg-config \
xvfb \ xvfb \
libglfw3-dev \ libglfw3 \
libuv1-dev \ libuv1 \
libjpeg-turbo8 \ libjpeg-turbo8 \
libicu66 \ libicu66 \
libcurl4-openssl-dev; \ libcairo2 \
libgif7 \
libopengl0 \
libpixman-1-0 \
libcurl4 \
librsvg2-2 \
libpango1.0; \
wget -qO- https://deb.nodesource.com/setup_16.x | bash; \ wget -qO- https://deb.nodesource.com/setup_16.x | bash; \
apt-get install -y nodejs; \ apt-get install -y nodejs; \
apt-get -y remove wget; \ apt-get -y remove wget; \
@ -48,7 +70,9 @@ RUN set -ex; \
apt-get clean; \ apt-get clean; \
rm -rf /var/lib/apt/lists/*; rm -rf /var/lib/apt/lists/*;
COPY --from=builder /usr/src/app /app COPY --from=builder /usr/src/app /usr/src/app
COPY . /usr/src/app
VOLUME /data VOLUME /data
WORKDIR /data WORKDIR /data
@ -57,4 +81,4 @@ EXPOSE 80
USER node:node USER node:node
ENTRYPOINT ["/app/docker-entrypoint.sh"] ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]

View file

@ -20,7 +20,7 @@ trap refresh HUP
if ! which -- "${1}"; then if ! which -- "${1}"; then
# first arg is not an executable # first arg is not an executable
xvfb-run -a --server-args="-screen 0 1024x768x24" -- node /app/ -p 80 "$@" & xvfb-run -a --server-args="-screen 0 1024x768x24" -- node /usr/src/app/ -p 80 "$@" &
# Wait exits immediately on signals which have traps set. Store return value and wait # Wait exits immediately on signals which have traps set. Store return value and wait
# again for all jobs to actually complete before continuing. # again for all jobs to actually complete before continuing.
wait $! || RETVAL=$? wait $! || RETVAL=$?