Spaces:
Paused
Paused
Update Dockerfile
Browse files123456789101112131415161718192021222324252627282930313233343536FROM python:latestENV PYTHONUNBUFFERED 1EXPOSE 7860RUN apt updateRUN apt upgrade -yRUN apt install curl -yRUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -RUN apt install nodejs -yRUN apt install neofetch -yRUN apt install ffmpeg -yRUN apt --yes install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0RUN useradd -m -u 1000 userUSER userENV HOME=/home/user \PATH=/home/user/.local/bin:$PATHWORKDIR $HOME/appCOPY --chown=user package*.json .RUN npm installCOPY --chown=user . .CMD [ "node", "server.js" ]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253# Use the latest Python image as the base imageFROM python:latest# Set environment variablesENV PYTHONUNBUFFERED 1# Expose the port that the server will run onEXPOSE 7860# Update the package list and upgrade existing packagesRUN apt update && apt upgrade -y# Install required packagesRUN apt install curl -y# Add NodeSource APT repository for Node 18.xRUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -# Install Node.js and npmRUN apt install nodejs -y# Install NeofetchRUN apt install neofetch -y# Install FFmpegRUN apt install ffmpeg -y# Install additional dependencies for PuppeteerRUN apt --yes install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0# Install ImageMagickRUN apt install imagemagick -y# Create a non-root user and switch to itRUN useradd -m -u 1000 userUSER user# Set environment variables for the userENV HOME=/home/user \PATH=/home/user/.local/bin:$PATH# Set the working directoryWORKDIR $HOME/app# Copy package.json and package-lock.json files and install dependenciesCOPY --chown=user package*.json .RUN npm install# Copy the rest of the application codeCOPY --chown=user . .# Start the applicationCMD ["node", "index.js"]
Dockerfile+23-6