-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 809 Bytes
/
Copy pathDockerfile
File metadata and controls
39 lines (30 loc) · 809 Bytes
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
# Use Ubuntu-based Python image (more compatible)
FROM python:3.10
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
libgomp1 \
libfontconfig1 \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (for better Docker caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create outputs directory
RUN mkdir -p outputs
# Expose the port that Gradio runs on
EXPOSE 7860
# Set environment variables
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
# Run the application
CMD ["python", "app_local.py"]