Rianofc commited on
Commit
7476f7c
·
verified ·
1 Parent(s): 62981a8

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -0
Dockerfile ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Gunakan image Playwright sebagai base
2
+ FROM mcr.microsoft.com/playwright:focal
3
+ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD 1
4
+
5
+ # Install Python 3.9 dan pip
6
+ RUN apt-get update && \
7
+ apt-get upgrade -y && \
8
+ apt-get install -y software-properties-common && \
9
+ add-apt-repository ppa:deadsnakes/ppa && \
10
+ apt-get update && \
11
+ apt-get install -y python3.9 python3.9-venv python3.9-dev python3-pip && \
12
+ rm -rf /var/lib/apt/lists/* && \
13
+ update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
14
+
15
+ # Set Timezone
16
+ ENV TZ=Asia/Jakarta
17
+ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
18
+
19
+ # Set Workdir
20
+ WORKDIR /app
21
+
22
+ # Copy semua file proyek
23
+ COPY . .
24
+
25
+ # Set permission agar Playwright dapat berjalan dengan benar
26
+ RUN chmod -R 777 /app
27
+
28
+ # Install dependencies Python
29
+ # Install dependencies Node.js untuk Playwright
30
+ RUN npm cache clean --force && \
31
+ npm install --force && \
32
+ npx playwright install chromium --with-deps
33
+
34
+ # Expose port API
35
+ EXPOSE 7860
36
+
37
+ # Jalankan FastAPI
38
+ CMD ["npm", "start"]