Nexchan commited on
Commit
cdfe6b4
1 Parent(s): 5136b5e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -51
Dockerfile CHANGED
@@ -1,55 +1,34 @@
1
- # Gunakan image node:latest sebagai base image
2
- FROM node:latest
3
-
4
- # Instal dependensi yang diperlukan untuk Chromium dan Puppeteer
5
- RUN apt-get update \
6
- && apt-get install -y \
7
- wget \
8
- ca-certificates \
9
- fonts-liberation \
10
- libappindicator3-1 \
11
- libasound2 \
12
- libatk-bridge2.0-0 \
13
- libatk1.0-0 \
14
- libcups2 \
15
- libdbus-1-3 \
16
- libdrm2 \
17
- libgbm1 \
18
- libgtk-3-0 \
19
- libnspr4 \
20
- libnss3 \
21
- libx11-xcb1 \
22
- libxcomposite1 \
23
- libxdamage1 \
24
- libxkbcommon0 \
25
- libxrandr2 \
26
- xdg-utils \
27
- --no-install-recommends \
28
- && apt-get clean \
29
- && rm -rf /var/lib/apt/lists/*
30
-
31
- # Instal Chromium
32
- RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
33
- && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
34
- && apt-get update \
35
- && apt-get install -y google-chrome-stable \
36
- && apt-get clean \
37
- && rm -rf /var/lib/apt/lists/*
38
-
39
- #buat dir
40
- WORKDIR /app
41
-
42
- #copy
43
- COPY package.json .
44
-
45
- # Instal Puppeteer
46
- RUN npm install
47
 
48
- # Copy aplikasi Node.js Anda ke dalam container
49
- COPY . .
50
 
51
- #EXPOSE KE PORT
52
  EXPOSE 7860
53
 
54
- # Menjalankan aplikasi Node.js
55
- CMD [ "npm", "start" ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:latest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
+ ENV PYTHONUNBUFFERED 1
 
4
 
 
5
  EXPOSE 7860
6
 
7
+ RUN apt update
8
+
9
+ RUN apt install curl
10
+
11
+ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
12
+
13
+ RUN apt install nodejs
14
+
15
+ RUN apt --yes install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0
16
+
17
+ RUN useradd -m -u 1000 user
18
+ USER user
19
+ ENV HOME=/home/user \
20
+ PATH=/home/user/.local/bin:$PATH
21
+
22
+ WORKDIR $HOME/app
23
+
24
+ COPY --chown=user package*.json .
25
+
26
+ RUN npm install
27
+
28
+ COPY requirements.txt ./
29
+ RUN pip install --upgrade pip && \
30
+ pip install -r requirements.txt
31
+
32
+ COPY --chown=user . .
33
+
34
+ CMD [ "npm", "run", "start" ]