TechAvenger commited on
Commit
0240937
·
verified ·
1 Parent(s): d8a58f5

Upload 7 files

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -10
Dockerfile CHANGED
@@ -1,32 +1,31 @@
1
  FROM python:3.9-slim
2
 
3
- # Prevent Python buffering
4
  ENV PYTHONUNBUFFERED=1
5
 
6
- # Create non-root user
 
 
 
 
 
 
 
 
7
  RUN useradd -m -u 1000 user
8
 
9
- # Set working directory
10
  WORKDIR /app
11
 
12
- # Copy requirements first for better Docker caching
13
  COPY requirements.txt .
14
 
15
- # Install dependencies
16
  RUN pip install --no-cache-dir --upgrade pip && \
17
  pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy project files
20
  COPY . .
21
 
22
- # Change ownership
23
  RUN chown -R user:user /app
24
 
25
- # Switch to non-root user
26
  USER user
27
 
28
- # Expose Hugging Face Spaces port
29
  EXPOSE 7860
30
 
31
- # Run application
32
  CMD ["python", "app.py"]
 
1
  FROM python:3.9-slim
2
 
 
3
  ENV PYTHONUNBUFFERED=1
4
 
5
+ # Install tkinter system libraries
6
+ RUN apt-get update && apt-get install -y \
7
+ python3-tk \
8
+ tk \
9
+ tk-dev \
10
+ libtk8.6 \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Create user
14
  RUN useradd -m -u 1000 user
15
 
 
16
  WORKDIR /app
17
 
 
18
  COPY requirements.txt .
19
 
 
20
  RUN pip install --no-cache-dir --upgrade pip && \
21
  pip install --no-cache-dir -r requirements.txt
22
 
 
23
  COPY . .
24
 
 
25
  RUN chown -R user:user /app
26
 
 
27
  USER user
28
 
 
29
  EXPOSE 7860
30
 
 
31
  CMD ["python", "app.py"]