triflix commited on
Commit
5768d5b
·
verified ·
1 Parent(s): 95fad1d

Rename Dockerfile to Dockerfile1

Browse files
Files changed (2) hide show
  1. Dockerfile +0 -0
  2. Dockerfile1 +35 -0
Dockerfile DELETED
File without changes
Dockerfile1 ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a stable slim Python base
2
+ FROM python:3.11-slim
3
+
4
+ # Prevent Python from writing .pyc files and enable unbuffered stdout/stderr
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Ensure /tmp is present and writable (Hugging Face uses /tmp)
9
+ ENV TMPDIR=/tmp
10
+ RUN mkdir -p /tmp && chmod 1777 /tmp
11
+
12
+ # Create app directory
13
+ WORKDIR /app
14
+
15
+ # Copy project files
16
+ COPY . /app
17
+
18
+ # Install system dependencies required for pandas/openpyxl build
19
+ RUN apt-get update \
20
+ && apt-get install -y --no-install-recommends build-essential libpq-dev gcc g++ \
21
+ && rm -rf /var/lib/apt/lists/*
22
+
23
+ # Install Python dependencies
24
+ # If your pipeline requires google-genai, include it; otherwise adjust as needed.
25
+ RUN pip install --no-cache-dir fastapi uvicorn[standard] python-multipart jinja2 aiofiles pandas numpy openpyxl google-genai
26
+
27
+ # Create a non-root user (optional but recommended)
28
+ RUN useradd -m appuser || true
29
+ USER appuser
30
+
31
+ # Expose port
32
+ EXPOSE 7860
33
+
34
+ # Command to run the app
35
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]