Update Dockerfile
Browse files- Dockerfile +7 -4
Dockerfile
CHANGED
|
@@ -12,17 +12,20 @@ ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/
|
|
| 12 |
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
|
| 13 |
|
| 14 |
# Copy all files to the container
|
| 15 |
-
COPY
|
| 16 |
|
| 17 |
# Set the working directory
|
| 18 |
WORKDIR /
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Switch to the non-root user
|
| 21 |
USER appuser
|
| 22 |
|
| 23 |
-
# Install virtualenv and set up the virtual environment
|
| 24 |
-
RUN python -m venv /opt/venv
|
| 25 |
-
|
| 26 |
# Activate the virtual environment and install requirements
|
| 27 |
RUN /opt/venv/bin/pip install --no-cache-dir --upgrade pip && \
|
| 28 |
/opt/venv/bin/pip install --no-cache-dir --upgrade -r /requirements.txt
|
|
|
|
| 12 |
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
|
| 13 |
|
| 14 |
# Copy all files to the container
|
| 15 |
+
COPY . .
|
| 16 |
|
| 17 |
# Set the working directory
|
| 18 |
WORKDIR /
|
| 19 |
|
| 20 |
+
# Install virtualenv and set up the virtual environment as root
|
| 21 |
+
RUN python -m venv /opt/venv
|
| 22 |
+
|
| 23 |
+
# Change ownership of the virtual environment directory to the non-root user
|
| 24 |
+
RUN chown -R appuser:appgroup /opt/venv
|
| 25 |
+
|
| 26 |
# Switch to the non-root user
|
| 27 |
USER appuser
|
| 28 |
|
|
|
|
|
|
|
|
|
|
| 29 |
# Activate the virtual environment and install requirements
|
| 30 |
RUN /opt/venv/bin/pip install --no-cache-dir --upgrade pip && \
|
| 31 |
/opt/venv/bin/pip install --no-cache-dir --upgrade -r /requirements.txt
|