-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerFile
More file actions
32 lines (23 loc) · 876 Bytes
/
DockerFile
File metadata and controls
32 lines (23 loc) · 876 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
# Use an official Python runtime as a parent image
FROM python:3.8-slim-buster
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y git && \
apt-get clean
# Install Python dependencies without YOLOv5 entry
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Clone the specific version of YOLOv5
RUN git clone --branch v6.0 --depth 1 https://github.com/ultralytics/yolov5.git /app/yolov5
# Set an environment variable to ensure Python knows where to find YOLOv5 locally
ENV PYTHONPATH "${PYTHONPATH}:/app/yolov5"
# Copy the rest of your app's source code
COPY . /app
# Make port 5000 available to the world outside this container
EXPOSE 5001
# Define environment variable
ENV NAME World
# Run app.py when the container launches
CMD ["python", "app.py"]