leavoigt commited on
Commit
7f03854
·
verified ·
1 Parent(s): 111fe08

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ---------- Base Image ----------
2
+ FROM python:3.11.11
3
+
4
+ # ---------- Environment Variables ----------
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ OMP_NUM_THREADS=1 \
7
+ TOKENIZERS_PARALLELISM=false
8
+
9
+ # ---------- Create Non-Root User ----------
10
+ # Ensures proper file permissions for dev and runtime
11
+ RUN useradd -m -u 1000 user
12
+
13
+ # ---------- Set Working Directory ----------
14
+ WORKDIR /app
15
+
16
+ # ---------- Install Python Dependencies ----------
17
+ # Copy requirements and install as non-root user
18
+ COPY --chown=user requirements.txt .
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+
21
+ # ---------- Copy Project Files ----------
22
+ # Set appropriate ownership and permissions
23
+ COPY --link --chown=1000 . .
24
+
25
+ # ---------- Expose Application Port ----------
26
+ EXPOSE 7860
27
+
28
+ # ---------- Default Command ----------
29
+ # Launch app via module path
30
+ CMD ["python", "app.py"]