-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
47 lines (40 loc) · 1.11 KB
/
Dockerfile
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
38
39
40
41
42
43
44
45
46
47
FROM python:3.8-slim-buster
USER root
# Install system level dependencies
RUN apt-get update &&\
apt-get install\
gcc\
git-all\
libsm6\
libxext6\
musl-dev\
nano\
nginx\
python3-dev\
python3-pip\
systemd\
unzip\
wget\
zip\
-y\
&& apt-get autoremove -y\
&& apt-get clean -y\
&& rm -rf /var/lib/apt/lists/*
# Copy nginx configuration file, pip requirements, entrypoint script, and get-pip.py script
ADD nginx_host /etc/nginx/sites-enabled/default
ADD entrypoint.sh /entrypoint.sh
ADD config.py /app/config.py
ADD app/requirements.txt /app/requirements.txt
ADD get-pip.py /app/get-pip.py
ADD /app/yolov5 /app/yolov5
ADD /app/best.pt /app/best.pt
# Install pip and dependencies using the locally copied get-pip.py
RUN python3 /app/get-pip.py \
&& python3 -m pip install -U pip \
&& python3 -m pip install -r /app/requirements.txt \
&& python3 -m pip install gunicorn
# Copy the app to be used when starting the Docker container and set permissions
COPY ./app /app
RUN chmod +x /entrypoint.sh && chmod -R 755 /app
EXPOSE 80
CMD ["/entrypoint.sh"]