File size: 812 Bytes
d13d7e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use an official Python runtime as a parent image
FROM python:3.10-slim

# Set environment variables
ENV PYTHONUNBUFFERED 1
# Set the port Uvicorn will listen on
ENV PORT 8000

# Set the working directory in the container
WORKDIR /app

# Install system dependencies needed by some Python packages (e.g., OpenCV)
RUN apt-get update && \

    apt-get install -y --no-install-recommends \
    build-essential \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app

RUN python -c "import depth_texture_mask; depth_texture_mask.init_midas()"

# Expose the port
EXPOSE ${PORT}

# Run using uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]