Skip to content

Commit

Permalink
Merge pull request #5 from BMW-InnovationLab/dev
Browse files Browse the repository at this point in the history
Docker fixes
  • Loading branch information
hadikoub authored Nov 15, 2024
2 parents c558802 + 643447c commit b2fe33f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 deletions.
36 changes: 24 additions & 12 deletions Dockerfile
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
20 changes: 10 additions & 10 deletions requirements.txt
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

0 comments on commit b2fe33f

Please sign in to comment.