starsnatched commited on
Commit
77852bc
·
unverified ·
2 Parent(s): 8c1df92 372692b

Merge pull request #93 from starsnatched/codex/create-dockerfile-for-gradio-app

Browse files
Files changed (2) hide show
  1. .dockerignore +6 -0
  2. Dockerfile +26 -0
.dockerignore ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ .git
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.db
5
+ uploads/
6
+ vm_state/
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official Python runtime as a parent image
2
+ FROM python:3.11-slim
3
+
4
+ # Ensure stdout/stderr logs are shown in real time
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ PIP_NO_CACHE_DIR=1
7
+
8
+ # Install any system dependencies if required
9
+ RUN apt-get update && apt-get install -y --no-install-recommends git \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Set working directory
13
+ WORKDIR /app
14
+
15
+ # Install Python dependencies first for better cache utilisation
16
+ COPY requirements.txt ./
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy the rest of the application code
20
+ COPY . .
21
+
22
+ # Expose Gradio default port (HuggingFace sets $PORT automatically)
23
+ EXPOSE 7860
24
+
25
+ # Start the Gradio application
26
+ CMD ["python", "app.py"]