From ead82a41178dd740f84b7fbffcbca44b7e7793a2 Mon Sep 17 00:00:00 2001 From: acalcutt Date: Sat, 1 Oct 2022 00:00:58 -0400 Subject: [PATCH] Move docker images to ubuntu --- Dockerfile | 44 ++++++++++++++++++++------------------------ Dockerfile_light | 16 +++++++++++++++- Dockerfile_test | 31 ++++++++++++++++--------------- 3 files changed, 51 insertions(+), 40 deletions(-) diff --git a/Dockerfile b/Dockerfile index dc9e0a2..ea48dd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,16 @@ -FROM node:16-bullseye AS builder +FROM ubuntu:focal AS builder RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qq update \ && apt-get -y --no-install-recommends install \ - apt-transport-https \ - curl \ - unzip \ - build-essential \ - python \ - libcairo2-dev \ - libgles2-mesa-dev \ - libgbm-dev \ - libprotobuf-dev \ + ca-certificates \ + wget \ && apt-get -y --purge autoremove \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* + +RUN wget -qO- https://deb.nodesource.com/setup_16.x | bash +RUN apt-get install -y nodejs COPY . /usr/src/app @@ -23,29 +19,29 @@ ENV NODE_ENV="production" RUN cd /usr/src/app && npm install --production -FROM node:16-bullseye-slim AS final +FROM ubuntu:focal AS final + +RUN groupadd -r node && useradd -r -g node node RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qq update \ && apt-get -y --no-install-recommends install \ - libgles2-mesa \ - libegl1 \ + ca-certificates \ + wget \ + pkg-config \ xvfb \ - xauth \ - libopengl0 \ - libcurl4 \ - curl \ + libglfw3-dev \ libuv1-dev \ - libc6-dev \ - libcap2-bin \ + libjpeg-turbo8 \ + libicu66 \ + unzip \ + libcurl4-openssl-dev \ && apt-get -y --purge autoremove \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* - -RUN curl http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb --output libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb -RUN apt install ./libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb -RUN curl http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2_amd64.deb --output libicu66_66.1-2ubuntu2_amd64.deb -RUN apt install ./libicu66_66.1-2ubuntu2_amd64.deb + +RUN wget -qO- https://deb.nodesource.com/setup_16.x | bash +RUN apt-get install -y nodejs COPY --from=builder /usr/src/app /app diff --git a/Dockerfile_light b/Dockerfile_light index 4112bf9..2ae0342 100644 --- a/Dockerfile_light +++ b/Dockerfile_light @@ -1,4 +1,17 @@ -FROM node:16-bullseye +FROM ubuntu:focal + +RUN export DEBIAN_FRONTEND=noninteractive \ + && apt-get -qq update \ + && apt-get -y --no-install-recommends install \ + ca-certificates \ + wget \ + && apt-get -y --purge autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN wget -qO- https://deb.nodesource.com/setup_16.x | bash +RUN apt-get install -y nodejs +RUN groupadd -r node && useradd -r -g node node ENV NODE_ENV="production" ENV CHOKIDAR_USEPOLLING=1 @@ -12,3 +25,4 @@ RUN mkdir -p /usr/src/app COPY / /usr/src/app RUN cd /usr/src/app && npm install --production RUN ["chmod", "+x", "/usr/src/app/docker-entrypoint.sh"] +USER node:node diff --git a/Dockerfile_test b/Dockerfile_test index 227e1cb..2e9d51b 100644 --- a/Dockerfile_test +++ b/Dockerfile_test @@ -2,25 +2,25 @@ # Simply run "docker build -f Dockerfile_test ." # WARNING: sometimes it fails with a core dumped exception -FROM node:16-bullseye +FROM ubuntu:focal RUN apt-get -qq update \ && DEBIAN_FRONTEND=noninteractive apt-get -y install \ - apt-transport-https \ - curl \ - unzip \ - build-essential \ - python \ - libcairo2-dev \ - libgles2-mesa-dev \ - libgbm-dev \ - libllvm3.9 \ - libprotobuf-dev \ - libxxf86vm-dev \ - libopengl0 \ - xvfb \ + ca-certificates \ + wget \ + pkg-config \ + xvfb \ + libglfw3-dev \ + libuv1-dev \ + libjpeg-turbo8 \ + libicu66 \ + unzip \ + libcurl4-openssl-dev \ && apt-get clean +RUN wget -qO- https://deb.nodesource.com/setup_16.x | bash +RUN apt-get install -y nodejs + RUN mkdir -p /usr/src/app WORKDIR /usr/src/app @@ -31,5 +31,6 @@ ENV NODE_ENV="test" COPY package.json . RUN npm install -COPY / . +COPY . . +RUN ls RUN xvfb-run --server-args="-screen 0 1024x768x24" npm test