piyush3 commited on
Commit
128b2ee
·
verified ·
1 Parent(s): fa898f6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ # Install system dependencies for OpenCV
4
+ RUN apt-get update && apt-get install -y \
5
+ libgl1-mesa-glx \
6
+ libglib2.0-0 \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Create and switch to non-root user
10
+ RUN useradd -m -u 1000 user
11
+ USER user
12
+ ENV PATH="/home/user/.local/bin:$PATH"
13
+
14
+ WORKDIR /app
15
+
16
+ # Copy and install requirements
17
+ COPY --chown=user ./requirements.txt requirements.txt
18
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
+
20
+ # Copy application code
21
+ COPY --chown=user . /app
22
+
23
+ # Create directories for model weights and static files
24
+ RUN mkdir -p /app/static /app/templates
25
+
26
+ # Expose port
27
+ EXPOSE 5000
28
+
29
+ # Run Flask application
30
+ CMD ["python", "app.py"]