ducnguyen1978 commited on
Commit
451c902
·
verified ·
1 Parent(s): a6700af

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -0
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Translation AI Agent - Docker Configuration
2
+ FROM python:3.9-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ git \
10
+ ffmpeg \
11
+ libsndfile1 \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Copy requirements first for better caching
15
+ COPY requirements.txt .
16
+
17
+ # Install Python dependencies
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ # Copy application code
21
+ COPY app.py .
22
+ COPY README.md .
23
+
24
+ # Create non-root user for security
25
+ RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
26
+ USER appuser
27
+
28
+ # Expose port
29
+ EXPOSE 7860
30
+
31
+ # Health check
32
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
33
+ CMD curl -f http://localhost:7860/health || exit 1
34
+
35
+ # Run application
36
+ CMD ["python", "app.py"]