AIdentify / Dockerfile
rein0421's picture
Update Dockerfile
dd1ea38 verified
raw
history blame
760 Bytes
# Use the official Python 3.10.9 image
FROM python:3.10.9
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into /app inside the container
COPY . /app
# Install dependencies for OpenCV and other requirements
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 curl
# Create a user to avoid permission issues
RUN useradd -m appuser
USER appuser
# Add /home/appuser/.local/bin to PATH
ENV PATH="/home/appuser/.local/bin:${PATH}"
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
# Set the FastAPI app environment variable to point to the app file path
ENV PYTHONPATH=/app
# Start the FastAPI app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]