veltrixcode commited on
Commit
b57577e
·
verified ·
1 Parent(s): 940d0a8

Upload 8 files

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -8
Dockerfile CHANGED
@@ -1,22 +1,35 @@
1
- FROM python:3.11-slim
2
 
3
- ENV PYTHONUNBUFFERED=1 \
 
4
  PIP_NO_CACHE_DIR=1 \
5
  PORT=7860
6
 
7
- # System deps
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
- build-essential \
 
10
  curl \
 
 
 
 
 
 
 
 
 
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  WORKDIR /app
14
 
15
- # Copy only requirements first for caching
16
  COPY requirements.txt /app/requirements.txt
17
- RUN pip install --upgrade pip && pip install -r /app/requirements.txt
 
18
 
19
- # Copy app code
20
  COPY . /app
21
 
22
  # Non-root user
@@ -25,5 +38,5 @@ USER appuser
25
 
26
  EXPOSE 7860
27
 
28
- # Hugging Face Spaces sets $PORT; default to 7860
29
  CMD ["sh", "-c", "waitress-serve --host=0.0.0.0 --port=${PORT:-7860} app:app"]
 
1
+ FROM ubuntu:22.04
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ PYTHONUNBUFFERED=1 \
5
  PIP_NO_CACHE_DIR=1 \
6
  PORT=7860
7
 
8
+ # System deps and Python 3.11
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ software-properties-common \
11
+ ca-certificates \
12
  curl \
13
+ git \
14
+ build-essential \
15
+ pkg-config \
16
+ && add-apt-repository ppa:deadsnakes/ppa -y \
17
+ && apt-get update && apt-get install -y --no-install-recommends \
18
+ python3.11 \
19
+ python3.11-venv \
20
+ python3.11-distutils \
21
+ python3-pip \
22
+ && update-ca-certificates \
23
  && rm -rf /var/lib/apt/lists/*
24
 
25
  WORKDIR /app
26
 
27
+ # Copy only requirements first for better layer caching
28
  COPY requirements.txt /app/requirements.txt
29
+ RUN python3.11 -m pip install --upgrade pip \
30
+ && python3.11 -m pip install -r /app/requirements.txt
31
 
32
+ # Copy source
33
  COPY . /app
34
 
35
  # Non-root user
 
38
 
39
  EXPOSE 7860
40
 
41
+ # Hugging Face Spaces provides $PORT
42
  CMD ["sh", "-c", "waitress-serve --host=0.0.0.0 --port=${PORT:-7860} app:app"]