2024-01-16 01:46:22 +03:00
|
|
|
FROM ubuntu:jammy
|
2022-10-05 16:11:03 +03:00
|
|
|
|
|
|
|
ENV \
|
|
|
|
NODE_ENV="production" \
|
|
|
|
CHOKIDAR_USEPOLLING=1 \
|
|
|
|
CHOKIDAR_INTERVAL=500
|
|
|
|
|
|
|
|
RUN set -ex; \
|
|
|
|
export DEBIAN_FRONTEND=noninteractive; \
|
|
|
|
groupadd -r node; \
|
|
|
|
useradd -r -g node node; \
|
|
|
|
apt-get -qq update; \
|
|
|
|
apt-get -y --no-install-recommends install \
|
|
|
|
ca-certificates \
|
2023-10-25 07:15:46 +03:00
|
|
|
curl \
|
|
|
|
gnupg; \
|
|
|
|
mkdir -p /etc/apt/keyrings; \
|
|
|
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
|
2024-01-16 01:46:22 +03:00
|
|
|
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
|
2023-10-25 07:15:46 +03:00
|
|
|
apt-get -qq update; \
|
2023-10-31 17:05:11 +03:00
|
|
|
apt-get install -y nodejs; \
|
|
|
|
npm i -g npm@latest; \
|
2023-10-25 07:15:46 +03:00
|
|
|
apt-get -y remove curl gnupg; \
|
2022-10-05 16:11:03 +03:00
|
|
|
apt-get -y --purge autoremove; \
|
|
|
|
apt-get clean; \
|
|
|
|
rm -rf /var/lib/apt/lists/*;
|
2016-12-08 20:18:19 +03:00
|
|
|
|
2022-11-21 07:00:41 +03:00
|
|
|
EXPOSE 8080
|
2022-11-07 04:31:26 +03:00
|
|
|
|
2023-02-26 05:01:34 +03:00
|
|
|
RUN mkdir -p /data; \
|
|
|
|
chown node:node /data; \
|
|
|
|
mkdir -p /usr/src/app;
|
|
|
|
|
2017-09-20 09:03:46 +03:00
|
|
|
VOLUME /data
|
2023-02-26 05:01:34 +03:00
|
|
|
|
2017-09-20 09:03:46 +03:00
|
|
|
WORKDIR /data
|
|
|
|
|
|
|
|
COPY / /usr/src/app
|
2023-02-26 05:01:34 +03:00
|
|
|
|
|
|
|
RUN cd /usr/src/app; \
|
2023-10-31 21:49:35 +03:00
|
|
|
npm config set maxsockets 1; \
|
2023-10-31 19:51:53 +03:00
|
|
|
npm config set fetch-retries 5; \
|
|
|
|
npm config set fetch-retry-mintimeout 100000; \
|
|
|
|
npm config set fetch-retry-maxtimeout 600000; \
|
|
|
|
npm install --omit=dev; \
|
2023-02-26 05:01:34 +03:00
|
|
|
chown -R root:root /usr/src/app; \
|
|
|
|
chmod +x /usr/src/app/docker-entrypoint.sh;
|
|
|
|
|
2022-10-05 16:11:03 +03:00
|
|
|
USER node:node
|
2023-02-26 05:01:34 +03:00
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
|
|
|
|
|
|
|
|
HEALTHCHECK CMD node /usr/src/app/src/healthcheck.js
|