| FROM ubuntu:latest | |
| # Update package lists and install dependencies | |
| ENV SUDO_FORCE_REMOVE=yes | |
| RUN apt-get update && \ | |
| apt-get install -y screenfetch software-properties-common adduser curl git && \ | |
| add-apt-repository ppa:deadsnakes/ppa -y | |
| # Install Node.js | |
| RUN apt-get install -y nodejs npm neofetch sudo | |
| RUN echo "ubuntu ALL=(ALL) NOPASSWD: /usr/bin/apt, /usr/bin/apt-get, /usr/bin/dpkg" > /etc/sudoers.d/ubuntu && chmod 440 /etc/sudoers.d/ubuntu | |
| # Set the working directory | |
| WORKDIR /app | |
| # Copy package.json and package-lock.json | |
| COPY package*.json ./ | |
| # Install dependencies | |
| RUN npm install | |
| # Copy the rest of the application code | |
| COPY . . | |
| # Expose the port | |
| EXPOSE 7860 | |
| # Run the application | |
| CMD ["node", "server.js"] |