fix dockerfile, add tracker tests

This commit is contained in:
iPromKnight
2024-02-08 14:52:14 +00:00
committed by iPromKnight
parent 2b1bb5fb16
commit 373ca4e024
5 changed files with 531 additions and 50 deletions

View File

@@ -1,28 +1,24 @@
FROM node:lts-buster-slim as builder
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y python3 make g++ && \
rm -rf /var/lib/apt/lists/*
RUN npm install -g npm@^8 && npm config set python /usr/bin/python3
RUN apt update && apt install -y git && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY package.json ./
COPY yarn.lock ./
RUN yarn install
COPY . .
RUN npm run build
RUN yarn run build
RUN yarn install --production
# --- Runtime Stage ---
FROM node:lts-buster-slim
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app ./
RUN npm prune --omit=dev
ENV NODE_ENV production
ENV NODE_OPTIONS "--no-deprecation"
# CIS-DI-0001
RUN useradd -d /home/consumer -m -s /bin/bash consumer