install deps before copy files

This commit is contained in:
SrGooglo 2025-02-25 23:25:03 +00:00
parent 2d962b8797
commit 04f0a1da2f

View File

@ -18,6 +18,12 @@ WORKDIR /comty-server
# Copy Files
COPY package.json ./
# Install modules & rebuild for host
RUN npm install
RUN npm rebuild @tensorflow/tfjs-node --build-from-source
# Copy Files
COPY . .
# Fix permissions
@ -27,10 +33,6 @@ RUN chown -R node:node /comty-server
# Set user to node
USER node
# Install modules & rebuild for host
RUN npm install
RUN npm rebuild @tensorflow/tfjs-node --build-from-source
# Start server
RUN export NODE_ENV=production
CMD ["npm", "run", "start:prod"]
CMD ["npm", "run", "start:prod"]