Trouter-Library commited on
Commit
5f08f98
·
verified ·
1 Parent(s): 1589966

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +58 -0
Dockerfile ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Helion-OSC Docker Image
2
+ FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
3
+
4
+ # Set environment variables
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+ ENV PYTHONUNBUFFERED=1
7
+ ENV CUDA_HOME=/usr/local/cuda
8
+ ENV PATH=${CUDA_HOME}/bin:${PATH}
9
+ ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
10
+
11
+ # Install system dependencies
12
+ RUN apt-get update && apt-get install -y \
13
+ python3.10 \
14
+ python3-pip \
15
+ git \
16
+ wget \
17
+ curl \
18
+ vim \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ # Upgrade pip
22
+ RUN pip3 install --upgrade pip setuptools wheel
23
+
24
+ # Set working directory
25
+ WORKDIR /app
26
+
27
+ # Copy requirements
28
+ COPY requirements.txt .
29
+
30
+ # Install Python dependencies
31
+ RUN pip3 install --no-cache-dir -r requirements.txt
32
+
33
+ # Install additional dependencies for API server
34
+ RUN pip3 install --no-cache-dir \
35
+ fastapi \
36
+ uvicorn[standard] \
37
+ pydantic \
38
+ python-multipart
39
+
40
+ # Copy application files
41
+ COPY . .
42
+
43
+ # Create directories for models and cache
44
+ RUN mkdir -p /app/models /app/cache /app/outputs
45
+
46
+ # Set Hugging Face cache directory
47
+ ENV HF_HOME=/app/cache
48
+ ENV TRANSFORMERS_CACHE=/app/cache
49
+
50
+ # Expose port for API server
51
+ EXPOSE 8000
52
+
53
+ # Health check
54
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
55
+ CMD curl -f http://localhost:8000/health || exit 1
56
+
57
+ # Default command (can be overridden)
58
+ CMD ["python3", "api_server.py", "--host", "0.0.0.0", "--port", "8000"]