-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 984 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (27 loc) · 984 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
33
34
35
36
37
# Use the official Python base image
FROM python:3.10
# Set the working directory
WORKDIR /app
# Update the Debian OS, install virtualenv, and clean up the apt cache
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip install virtualenv
# Create a virtual environment and activate it
RUN virtualenv venv
ENV VIRTUAL_ENV=/app/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Copy the requirements file into the container
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt
# Install detectron2, used to read JPG file
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
# Copy the rest of the application into the container
COPY . .
#Load and index model
RUN python build.py
# Make port 5000 available to the world outside this container
EXPOSE 5000
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--timeout", "0", "server:app"]