Spaces:
Nexchan
/
Runtime error

Nexchan commited on
Commit
6de3a45
1 Parent(s): 297f180

Update Dockerfile

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