Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 2m23s
36 lines
746 B
Docker
36 lines
746 B
Docker
# Starting from node
|
|
FROM node:22-slim
|
|
|
|
# Install build dependencies
|
|
RUN apt-get update && \
|
|
apt-get install -y ffmpeg python3 make g++
|
|
|
|
# Set the working directory
|
|
WORKDIR /app
|
|
RUN chown node:node ./
|
|
USER node
|
|
|
|
# Copy package files first
|
|
COPY package.json package-lock.json* .
|
|
|
|
# Install app dependencies
|
|
ENV NODE_ENV=production
|
|
RUN npm ci --only=production --ignore-scripts && \
|
|
npm install bufferutil zlib-sync && \
|
|
npm cache clean --force
|
|
|
|
# Copy the builded files
|
|
COPY ./dist/* .
|
|
|
|
# Return to root user to remove build dependencies
|
|
USER root
|
|
RUN apt-get remove -y python3 make g++ && \
|
|
apt-get autoremove -y && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Go back to node user
|
|
USER node
|
|
|
|
# Start the application
|
|
CMD ["npm", "start"]
|