optimize dockerfile

This commit is contained in:
SrGooglo 2025-03-28 18:31:25 +00:00
parent 015d48fcd9
commit 93d2710f92

View File

@ -2,22 +2,19 @@ FROM node:22-bookworm-slim
EXPOSE 9000 EXPOSE 9000
# Install dependencies # Install dependencies
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt update RUN apt update
RUN apt install -y --no-install-recommends build-essential RUN apt install -y --no-install-recommends build-essential
RUN apt install -y --no-install-recommends curl
RUN apt install -y --no-install-recommends ffmpeg
RUN apt install -y --no-install-recommends yarn
RUN apt install -y --no-install-recommends git RUN apt install -y --no-install-recommends git
RUN apt install -y --no-install-recommends ssh RUN apt install -y --no-install-recommends ssh
RUN apt install -y --no-install-recommends curl
RUN apt install -y --no-install-recommends ca-certificates RUN apt install -y --no-install-recommends ca-certificates
RUN apt install -y --no-install-recommends ffmpeg
# Create workdir # Create workdir
RUN mkdir -p /comty-server RUN mkdir -p /comty-server
WORKDIR /comty-server WORKDIR /comty-server
# Copy Files # Copy Files
COPY package.json ./
COPY . . COPY . .
# Fix permissions # Fix permissions
@ -28,8 +25,8 @@ RUN chown -R node:node /comty-server
USER node USER node
# Install modules & rebuild for host # Install modules & rebuild for host
RUN npm install RUN npm install --omit=dev
RUN npm rebuild @tensorflow/tfjs-node --build-from-source #RUN npm rebuild @tensorflow/tfjs-node --build-from-source
# Start server # Start server
RUN export NODE_ENV=production RUN export NODE_ENV=production