# Use a Node.js image as the base FROM node:14.18.0 # Set the working directory inside the container WORKDIR /app # Update apt sources to use the Debian archive RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list && \ sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list && \ sed -i '/stretch-updates/d' /etc/apt/sources.list && \ echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until && \ apt-get update && apt-get install -y git && apt-get clean # Clone the repository RUN git clone https://github.com/ztjhz/BetterChatGPT.git . # Change ownership of the app directory to ensure proper file permissions RUN chown -R node:node /app # Switch to the non-root user for security and permission fixes USER node # Install dependencies using Yarn or npm # Uncomment the one you prefer (default: Yarn) # RUN npm install RUN yarn install # Expose the port the app runs on (adjust if necessary) EXPOSE 5173 # Start the development server CMD ["yarn", "dev"] #CMD ["/home/appuser/.yarn/bin/serve", "-s", "dist", "-l", "3000"]