File size: 774 Bytes
25a173a
6c0ac6b
2185caa
9d69895
 
2185caa
25a173a
2185caa
 
7e9fa29
2185caa
 
7e9fa29
 
9d69895
2185caa
 
 
 
 
 
 
 
 
 
 
 
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"]