Samfredoly commited on
Commit
318bc35
·
verified ·
1 Parent(s): 2a729e6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -32
Dockerfile CHANGED
@@ -1,32 +1,32 @@
1
- FROM python:3.11-slim
2
-
3
- WORKDIR /app
4
-
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- libopencv-dev \
9
- python3-opencv \
10
- && rm -rf /var/lib/apt/lists/*
11
-
12
- # Copy requirements
13
- COPY requirements.txt .
14
-
15
- # Install Python dependencies
16
- RUN pip install --no-cache-dir -r requirements.txt
17
-
18
- # Copy application code
19
- COPY . .
20
-
21
- # Create models directory
22
- RUN mkdir -p models
23
-
24
- # Expose port
25
- EXPOSE 8000
26
-
27
- # Health check
28
- HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
29
- CMD python -c "import requests; requests.get('http://localhost:8000/health')"
30
-
31
- # Run application
32
- CMD ["python", "main.py"]
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ libopencv-dev \
9
+ python3-opencv \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copy requirements
13
+ COPY requirements.txt .
14
+
15
+ # Install Python dependencies
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Copy application code
19
+ COPY . .
20
+
21
+ # Create models directory
22
+ RUN mkdir -p models
23
+
24
+ # Expose port
25
+ EXPOSE 8000
26
+
27
+ # Health check
28
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
29
+ CMD python -c "import requests; requests.get('http://localhost:8000/health')"
30
+
31
+ # Run application
32
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]