understanding commited on
Commit
96c728b
·
verified ·
1 Parent(s): 9225c3d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the requirements file first to leverage Docker cache
8
+ COPY requirements.txt .
9
+
10
+ # Install any needed packages specified in requirements.txt
11
+ # --no-cache-dir reduces image size, --upgrade pip ensures pip is up-to-date
12
+ RUN pip install --no-cache-dir --upgrade pip && \
13
+ pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Copy all files from the build context (app.py, etc.) into the working directory
16
+ COPY . .
17
+
18
+ # Create necessary directories that the app will use, as per user guidance
19
+ # 'data' for persistent items (template, font, config)
20
+ # 'downloads' for temporary raw images
21
+ # 'session' for the Telethon session file
22
+ RUN mkdir -p ./data ./downloads ./session && \
23
+ chmod -R 777 ./data ./downloads ./session
24
+
25
+ # Command to run the application when the container launches
26
+ CMD ["python", "app.py"]