Spaces:
Running
Running
File size: 1,271 Bytes
e92c3f3 d5fac92 b900167 e92c3f3 d5fac92 b900167 e92c3f3 d5fac92 b900167 e92c3f3 ad8f566 e92c3f3 ad8f566 b900167 e92c3f3 d5fac92 b900167 e92c3f3 ad8f566 d5fac92 e92c3f3 ad8f566 d5fac92 e92c3f3 ad8f566 d5fac92 e92c3f3 d5fac92 e92c3f3 d5fac92 e92c3f3 d5fac92 e92c3f3 d5fac92 e92c3f3 d5fac92 e92c3f3 d5fac92 b900167 e92c3f3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# Use the latest Python image as the base image
FROM python:latest
# Set environment variables
ENV PYTHONUNBUFFERED 1
# Expose the port that the server will run on
EXPOSE 7860
# Update the package list and upgrade existing packages
RUN apt update && apt upgrade -y
# Install required packages
RUN apt install curl -y
# Add NodeSource APT repository for Node 18.x
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
# Install Node.js and npm
RUN apt install nodejs -y
# Install Neofetch
RUN apt install neofetch -y
# Install FFmpeg
RUN apt install ffmpeg -y
# Install additional dependencies for Puppeteer
RUN apt --yes install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0
# Install ImageMagick
RUN apt install imagemagick -y
# Create a non-root user and switch to it
RUN useradd -m -u 1000 user
USER user
# Set environment variables for the user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory
WORKDIR $HOME/app
# Copy package.json and package-lock.json files and install dependencies
COPY --chown=user package*.json .
RUN npm install
# Copy the rest of the application code
COPY --chown=user . .
# Start the application
CMD ["node", "index.js"] |