FROM node:18 # Create app directory with root permissions WORKDIR /usr/src/app # Copy package files and install dependencies COPY package*.json ./ RUN npm install # Install necessary packages RUN npm install --save express ws # Copy the rest of the application files COPY . . # Set permissions for the working directory RUN chmod -R 777 /usr/src/app # Expose the WebSocket port EXPOSE 7860 # Run the application as root CMD ["node", "server.js"]