Nexchan commited on
Commit
0e6b5cb
·
verified ·
1 Parent(s): 88ed585

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -19
Dockerfile CHANGED
@@ -1,5 +1,7 @@
1
- # Use the latest Python image as the base image
2
- FROM python:latest
 
 
3
 
4
  # Set environment variables
5
  ENV PYTHONUNBUFFERED 1
@@ -7,47 +9,57 @@ ENV PYTHONUNBUFFERED 1
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 ["node", "index.js"]
 
1
+ # Menggunakan image Ubuntu Focal sebagai base image
2
+ FROM ubuntu:22.04
3
+
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
 
6
  # Set environment variables
7
  ENV PYTHONUNBUFFERED 1
 
9
  # Expose the port that the server will run on
10
  EXPOSE 7860
11
 
12
+ # Update the package list dan upgrade existing packages
13
  RUN apt update && apt upgrade -y
14
 
15
  # Install required packages
16
+ RUN apt install -y curl
17
+
18
+ # install py
19
+ RUN apt-get install -y curl neofetch ffmpeg \
20
+ libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0 imagemagick \
21
+ python3 python3-pip python3-venv build-essential libvips libvips-dev libjpeg-dev libpng-dev
22
+
23
+ RUN pip install gradio_client
24
+
25
  # Add NodeSource APT repository for Node 18.x
26
  RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
27
 
28
+ # CODE SERVER
29
+ RUN curl -fsSL https://code-server.dev/install.sh | sh
30
+
31
  # Install Node.js and npm
32
+ RUN apt install -y nodejs
33
 
34
  # Install Neofetch
35
+ RUN apt install -y neofetch
36
 
37
+ # Install FFmpeg dan dependencies lainnya
38
+ RUN apt install -y ffmpeg gnupg ca-certificates build-essential software-properties-common chromium-browser
39
 
40
  # Install additional dependencies for Puppeteer
41
+ RUN apt --yes install git libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0
42
 
43
  # Install ImageMagick
44
+ RUN apt install -y imagemagick
45
 
46
+ # Create a non-root user named Nex and switch to it
47
+ RUN useradd -m -u 1000 Nex
48
+ USER Nex
49
 
50
  # Set environment variables for the user
51
+ ENV HOME=/home/Nex \
52
+ PATH=/home/Nex/.local/bin:$PATH
53
 
54
  # Set the working directory
55
  WORKDIR $HOME/app
56
 
57
  # Copy package.json and package-lock.json files and install dependencies
58
+ COPY --chown=Nex package*.json .
59
  RUN npm install
60
 
61
  # Copy the rest of the application code
62
+ COPY --chown=Nex . .
63
 
64
  # Start the application
65
+ CMD ["code-server", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]