Skip to content

Commit 643447c

Browse files
committed
(Fix): added opencv requirements to docker and added versions to requirements.txt
1 parent c558802 commit 643447c

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

Dockerfile

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,44 @@
1-
FROM tiangolo/uvicorn-gunicorn:python3.6 AS uvicorn-builder
1+
FROM tiangolo/uvicorn-gunicorn:python3.9 AS uvicorn-builder
22
FROM openvino/ubuntu18_runtime:2021.4
33

44
USER root
55

6-
# Copy scripts form uvicorn-builder (this is the only purpose of the uvicorn-builder build stage)
6+
# Log start of copying scripts
77
COPY --from=uvicorn-builder /start.sh /start.sh
88
COPY --from=uvicorn-builder /start-reload.sh /start-reload.sh
99

1010
# Update pip
11-
ENV DEBIAN_FRONTEND noninteractive
11+
ENV DEBIAN_FRONTEND=noninteractive
1212
RUN python3 -m pip install --upgrade pip
1313

14-
# Install dependencies
14+
# Install build tools and OpenCV dependencies
15+
RUN apt-get update && apt-get install -y \
16+
build-essential \
17+
cmake \
18+
ninja-build \
19+
pkg-config \
20+
libgl1-mesa-glx \
21+
libglib2.0-0
22+
23+
# Log the installation of Python dependencies
1524
COPY requirements.txt requirements.txt
1625
RUN python3 -m pip install -U -r requirements.txt
1726

18-
# Configure webserver settings
19-
ENV HOST 0.0.0.0
20-
ENV PORT 80
21-
ENV WORKERS_PER_CORE 1
22-
ENV WEB_CONCURRENCY 1
23-
ENV LOG_LEVEL debug
27+
ENV HOST=0.0.0.0
28+
ENV PORT=80
29+
ENV WORKERS_PER_CORE=1
30+
ENV WEB_CONCURRENCY=1
31+
ENV LOG_LEVEL=debug
32+
ENV ACCESS_LOG=True
33+
ENV ERROR_LOG=True
2434

2535
EXPOSE 80
2636

37+
# Log the copying of application files
2738
COPY src/main /app
2839
WORKDIR /app
2940

30-
# Setup OpenVINO environment vars before starting
41+
# Setup OpenVINO and start the app
3142
CMD source /opt/intel/openvino/bin/setupvars.sh && \
32-
/start.sh
43+
echo "OpenVINO environment setup completed." && \
44+
/start.sh --log-level debug --access-log

requirements.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
aiofiles
2-
celery
3-
fastapi
4-
numpy
5-
opencv-python>=4.0.0.0
6-
python-multipart
7-
Pillow
8-
python-socketio
9-
requests
1+
aiofiles==0.8.0
2+
celery==5.1.2 # Updated to a valid version
3+
fastapi==0.83.0
4+
numpy== 1.19.5
5+
opencv-python>=4.10.0.84
6+
python-multipart==0.0.5
7+
Pillow==8.4.0
8+
python-socketio==5.11.0
9+
requests==2.27.1
1010
uvicorn==0.11.5
1111
gunicorn==20.0.4
12-
jsonschema
12+
jsonschema==4.0.0

0 commit comments

Comments
 (0)