File size: 774 Bytes
8b247b9 07631e1 902fb2b 11c6d04 902fb2b 8b247b9 902fb2b 48d1efa 902fb2b 48d1efa 11c6d04 902fb2b |
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 |
FROM python:3.10.9
# Copy all files to the container
COPY . .
# Set the working directory
WORKDIR /
# Create the directories with appropriate permissions
RUN mkdir -m 777 /tmp/NUMBA_CACHE_DIR /tmp/MPLCONFIGDIR
# Set environment variables
ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
# Install virtualenv
RUN python -m venv /opt/venv
# Activate the virtual environment and install requirements
RUN /opt/venv/bin/pip install --no-cache-dir --upgrade pip && \
/opt/venv/bin/pip install --no-cache-dir --upgrade -r /requirements.txt
# Ensure the virtual environment is activated for subsequent commands
ENV PATH="/opt/venv/bin:$PATH"
# Command to run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|