Update Dockerfile
Browse files- Dockerfile +18 -2
Dockerfile
CHANGED
@@ -1,11 +1,27 @@
|
|
1 |
FROM python:3.10.9
|
2 |
|
|
|
3 |
COPY . .
|
4 |
|
|
|
5 |
WORKDIR /
|
|
|
|
|
6 |
RUN mkdir -m 777 /tmp/NUMBA_CACHE_DIR /tmp/MPLCONFIGDIR
|
|
|
|
|
7 |
ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/
|
8 |
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
|
9 |
-
RUN pip install --no-cache-dir --upgrade -r /requirements.txt
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.10.9
|
2 |
|
3 |
+
# Copy all files to the container
|
4 |
COPY . .
|
5 |
|
6 |
+
# Set the working directory
|
7 |
WORKDIR /
|
8 |
+
|
9 |
+
# Create the directories with appropriate permissions
|
10 |
RUN mkdir -m 777 /tmp/NUMBA_CACHE_DIR /tmp/MPLCONFIGDIR
|
11 |
+
|
12 |
+
# Set environment variables
|
13 |
ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/
|
14 |
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
|
|
|
15 |
|
16 |
+
# Install virtualenv
|
17 |
+
RUN python -m venv /opt/venv
|
18 |
+
|
19 |
+
# Activate the virtual environment and install requirements
|
20 |
+
RUN /opt/venv/bin/pip install --no-cache-dir --upgrade pip && \
|
21 |
+
/opt/venv/bin/pip install --no-cache-dir --upgrade -r /requirements.txt
|
22 |
+
|
23 |
+
# Ensure the virtual environment is activated for subsequent commands
|
24 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
25 |
+
|
26 |
+
# Command to run the application
|
27 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|