Move docker images to ubuntu
This commit is contained in:
parent
38604c0a45
commit
ead82a4117
3 changed files with 51 additions and 40 deletions
42
Dockerfile
42
Dockerfile
|
|
@ -1,21 +1,17 @@
|
|||
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
|
||||
|
||||
ENV NODE_ENV="production"
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue