yasserrmd commited on
Commit
9db3bcd
·
verified ·
1 Parent(s): b2c87cc

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11
2
+
3
+ # Create a non-root user
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV PATH="/home/user/.local/bin:$PATH"
7
+
8
+ # Set working directory
9
+ WORKDIR /app
10
+
11
+ # Copy only the requirements file first to install deps
12
+ COPY --chown=user src/requirements.txt ./requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ # Copy the entire project (src + root files like .db)
16
+ COPY --chown=user . .
17
+
18
+ # Set environment variable for Flask app location
19
+ ENV FLASK_APP=src/main.py
20
+
21
+ # Run the Flask app directly
22
+ CMD ["python", "src/main.py"]