-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from BMW-InnovationLab/dev
Docker fixes
- Loading branch information
Showing
2 changed files
with
34 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,44 @@ | ||
FROM tiangolo/uvicorn-gunicorn:python3.6 AS uvicorn-builder | ||
FROM tiangolo/uvicorn-gunicorn:python3.9 AS uvicorn-builder | ||
FROM openvino/ubuntu18_runtime:2021.4 | ||
|
||
USER root | ||
|
||
# Copy scripts form uvicorn-builder (this is the only purpose of the uvicorn-builder build stage) | ||
# Log start of copying scripts | ||
COPY --from=uvicorn-builder /start.sh /start.sh | ||
COPY --from=uvicorn-builder /start-reload.sh /start-reload.sh | ||
|
||
# Update pip | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN python3 -m pip install --upgrade pip | ||
|
||
# Install dependencies | ||
# Install build tools and OpenCV dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
ninja-build \ | ||
pkg-config \ | ||
libgl1-mesa-glx \ | ||
libglib2.0-0 | ||
|
||
# Log the installation of Python dependencies | ||
COPY requirements.txt requirements.txt | ||
RUN python3 -m pip install -U -r requirements.txt | ||
|
||
# Configure webserver settings | ||
ENV HOST 0.0.0.0 | ||
ENV PORT 80 | ||
ENV WORKERS_PER_CORE 1 | ||
ENV WEB_CONCURRENCY 1 | ||
ENV LOG_LEVEL debug | ||
ENV HOST=0.0.0.0 | ||
ENV PORT=80 | ||
ENV WORKERS_PER_CORE=1 | ||
ENV WEB_CONCURRENCY=1 | ||
ENV LOG_LEVEL=debug | ||
ENV ACCESS_LOG=True | ||
ENV ERROR_LOG=True | ||
|
||
EXPOSE 80 | ||
|
||
# Log the copying of application files | ||
COPY src/main /app | ||
WORKDIR /app | ||
|
||
# Setup OpenVINO environment vars before starting | ||
# Setup OpenVINO and start the app | ||
CMD source /opt/intel/openvino/bin/setupvars.sh && \ | ||
/start.sh | ||
echo "OpenVINO environment setup completed." && \ | ||
/start.sh --log-level debug --access-log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
aiofiles | ||
celery | ||
fastapi | ||
numpy | ||
opencv-python>=4.0.0.0 | ||
python-multipart | ||
Pillow | ||
python-socketio | ||
requests | ||
aiofiles==0.8.0 | ||
celery==5.1.2 # Updated to a valid version | ||
fastapi==0.83.0 | ||
numpy== 1.19.5 | ||
opencv-python>=4.10.0.84 | ||
python-multipart==0.0.5 | ||
Pillow==8.4.0 | ||
python-socketio==5.11.0 | ||
requests==2.27.1 | ||
uvicorn==0.11.5 | ||
gunicorn==20.0.4 | ||
jsonschema | ||
jsonschema==4.0.0 |