gilangf3000 commited on
Commit
f18a171
·
verified ·
1 Parent(s): c352db8

Create docker

Browse files
Files changed (1) hide show
  1. docker +34 -0
docker ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # Set environment variables
4
+ ENV TZ=Asia/Jakarta
5
+ ENV MADE=GILANGF3000
6
+ ENV PORT=5000
7
+
8
+ # Install dependencies
9
+ RUN apt-get update && \
10
+ apt-get upgrade -y && \
11
+ apt-get install -y git && \
12
+ rm -rf /var/lib/apt/lists/*
13
+
14
+ # Set working directory
15
+ WORKDIR /app
16
+
17
+ # Gunakan ARG untuk menyimpan GitHub Token dan Repository URL
18
+ ARG GITHUB_REPO
19
+ ARG GITHUB_TOKEN
20
+
21
+ # Clone repo menggunakan token (untuk repo privat)
22
+ RUN git clone --depth=1 https://${GITHUB_TOKEN}@${GITHUB_REPO} AI
23
+
24
+ # Set working directory ke dalam project
25
+ WORKDIR /app/AI
26
+
27
+ # Install dependencies jika requirements.txt ada
28
+ RUN test -f requirements.txt && pip install --no-cache-dir -r requirements.txt || echo "No requirements.txt found"
29
+
30
+ # Expose port untuk API
31
+ EXPOSE 5000
32
+
33
+ # Jalankan aplikasi Python
34
+ ENTRYPOINT ["python3", "app.py"]