dakunesu commited on
Commit
d5f57d0
·
verified ·
1 Parent(s): 4de8927

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -0
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python 3.10 image as the base image
2
+ FROM python:3.10
3
+
4
+ # install Git (if it's not already installed)
5
+ RUN apt-get update && apt-get install -y git
6
+
7
+ # force docker to rebuild from this step if version.json changes
8
+ ADD http://worldtimeapi.org/api/timezone/Asia/Jakarta version.json
9
+
10
+ # set timezone jakarta
11
+ ENV TZ=Asia/Jakarta
12
+
13
+ # git clone from private repo
14
+ RUN --mount=type=secret,id=GIT_REPO,mode=0444,required=true git clone $(cat /run/secrets/GIT_REPO) /app
15
+
16
+ # install packages from packages.txt (apt-get install) using xargs
17
+ COPY packages.txt .
18
+ RUN xargs apt-get -y install < packages.txt
19
+
20
+ # Set the working directory inside the container
21
+ WORKDIR /app
22
+
23
+ # allow permissions
24
+ RUN chmod -R 777 /app
25
+
26
+ # Install the Python dependencies
27
+ COPY requirements.txt .
28
+ RUN pip install --no-cache-dir -r requirements.txt
29
+
30
+ # Copy all the files from the host machine to the working directory in the container
31
+ COPY . .
32
+
33
+ # Set the command to run when the container starts
34
+ # This command will start the Flask application
35
+ CMD ["python", "src/app.py"]
36
+