Nexchan commited on
Commit
c86e3a4
1 Parent(s): 49ebcc9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -17
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,50 @@ 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:focal
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
  # Add NodeSource APT repository for Node 18.x
19
  RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
20
 
21
+ # CODE SERVER
22
+ RUN curl -fsSL https://code-server.dev/install.sh | sh
23
+
24
  # Install Node.js and npm
25
+ RUN apt install -y nodejs
26
 
27
  # Install Neofetch
28
+ RUN apt install -y neofetch
29
 
30
+ # Install FFmpeg dan dependencies lainnya
31
+ RUN apt install -y ffmpeg gnupg ca-certificates build-essential software-properties-common
32
 
33
  # Install additional dependencies for Puppeteer
34
  RUN apt --yes install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0
35
 
36
  # Install ImageMagick
37
+ RUN apt install -y imagemagick
38
 
39
+ # Create a non-root user named Nex and switch to it
40
+ RUN useradd -m -u 1000 Nex
41
+ USER Nex
42
 
43
  # Set environment variables for the user
44
+ ENV HOME=/home/Nex \
45
+ PATH=/home/Nex/.local/bin:$PATH
46
 
47
  # Set the working directory
48
  WORKDIR $HOME/app
49
 
50
  # Copy package.json and package-lock.json files and install dependencies
51
+ COPY --chown=Nex package*.json .
52
  RUN npm install
53
 
54
  # Copy the rest of the application code
55
+ COPY --chown=Nex . .
56
 
57
  # Start the application
58
+ CMD ["code-server", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]