File size: 995 Bytes
b7c86a5
 
 
 
 
 
 
 
 
 
 
 
5b9a0a5
 
 
 
 
 
 
 
b7c86a5
5b9a0a5
2869863
b7c86a5
 
 
 
 
5b9a0a5
b7c86a5
 
 
 
 
 
 
 
 
b07419a
 
 
 
 
b7c86a5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Use Python 3.10 as base image
FROM python:3.10-slim

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    git \
    && rm -rf /var/lib/apt/lists/*

# Create a non-root user and set up directories
RUN useradd -m -u 1000 user \
    && mkdir -p /app/.cache \
    && chown -R user:user /app

# Switch to non-root user
USER user

# Copy requirements first to leverage Docker cache
COPY --chown=user:user requirements.txt .
COPY --chown=user:user bitsandbytes-0.44.1.dev0-py3-none-manylinux_2_24_x86_64.whl .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application
COPY --chown=user:user . .

# Expose the port Gradio will run on
EXPOSE 7860

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860

# Run ls and pwd
RUN ls -la
RUN ls -la /app
RUN pwd

# Run the application
CMD ["python", "app.py"]