Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Signed-off-by: Bubbles The Dev <[email protected]>
  • Loading branch information
KernFerm authored Nov 11, 2024
1 parent 5661b02 commit d626cbf
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ultralytics1/utils/google_app_engine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use a slim official Python image for better control over Python version and size
FROM python:3.10-slim

# Set up environment variables for the virtual environment
ENV VIRTUAL_ENV=/env
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Install system dependencies and required libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
libopencv-dev \
&& rm -rf /var/lib/apt/lists/*

# Copy the application's requirements.txt and install Python dependencies
COPY requirements.txt /app/requirements.txt
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r /app/requirements.txt

# Copy the application source code
COPY . /app
WORKDIR /app

# Expose the port used by Gunicorn
EXPOSE $PORT

# Run Gunicorn to serve the application (ensure gunicorn is in requirements.txt)
CMD ["gunicorn", "-b", ":$PORT", "main:app"]

0 comments on commit d626cbf

Please sign in to comment.