File size: 1,049 Bytes
d5f57d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Use the official Python 3.10 image as the base image
FROM python:3.10

# install Git (if it's not already installed)
RUN apt-get update && apt-get install -y git

# force docker to rebuild from this step if version.json changes
ADD http://worldtimeapi.org/api/timezone/Asia/Jakarta version.json

# set timezone jakarta
ENV TZ=Asia/Jakarta

# git clone from private repo
RUN --mount=type=secret,id=GIT_REPO,mode=0444,required=true git clone $(cat /run/secrets/GIT_REPO) /app

# install packages from packages.txt (apt-get install) using xargs
COPY packages.txt .
RUN xargs apt-get -y install < packages.txt

# Set the working directory inside the container
WORKDIR /app

# allow permissions
RUN chmod -R 777 /app

# Install the Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy all the files from the host machine to the working directory in the container
COPY . .

# Set the command to run when the container starts
# This command will start the Flask application
CMD ["python", "src/app.py"]