FROM node:18-slim # Create the log and db directories and set permissions RUN mkdir -p /usr/src/app/log /usr/src/app/db && \ chown -R node:node /usr/src/app/log /usr/src/app/db # Set the working directory WORKDIR /usr/src/app # Copy package.json and package-lock.json first COPY package*.json ./ # Install dependencies RUN npm install # Copy the rest of your application files COPY . . # Command to run your application CMD ["node", "index.js"]