Update Dockerfile
Browse files- Dockerfile +9 -23
Dockerfile
CHANGED
@@ -1,36 +1,21 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
-
#
|
4 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
5 |
-
|
6 |
-
# Install Python and other dependencies
|
7 |
-
RUN apt-get update && apt-get install -y \
|
8 |
-
python3.10 \
|
9 |
-
python3-pip \
|
10 |
-
ffmpeg \
|
11 |
-
tzdata \
|
12 |
-
&& apt-get clean \
|
13 |
-
&& rm -rf /var/lib/apt/lists/*
|
14 |
-
|
15 |
-
# Configure the timezone (change to your preferred timezone)
|
16 |
-
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
|
17 |
-
dpkg-reconfigure --frontend noninteractive tzdata
|
18 |
-
|
19 |
-
# Set up the working directory
|
20 |
WORKDIR /app
|
21 |
|
22 |
-
# Copy the requirements file
|
23 |
COPY ./requirements.txt /app/requirements.txt
|
24 |
-
|
25 |
-
|
|
|
|
|
26 |
|
27 |
# Add and configure the user
|
28 |
RUN useradd -m -u 1000 user
|
29 |
|
30 |
# Set environment variables for the user
|
31 |
ENV HOME=/home/user \
|
32 |
-
PATH=/home/user/.local/bin:$PATH
|
33 |
-
CUDA_HOME=/
|
34 |
|
35 |
# Set the user and working directory
|
36 |
USER user
|
@@ -45,6 +30,7 @@ RUN chmod -R 777 $HOME/app
|
|
45 |
# Set additional environment variables
|
46 |
ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/
|
47 |
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
|
|
|
48 |
ENV PATH="/opt/venv/bin:$PATH"
|
49 |
|
50 |
# Set the command to run the application
|
|
|
1 |
+
FROM python:3.10.9
|
2 |
|
3 |
+
# Use a more secure method for setting the working directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Copy the requirements file
|
7 |
COPY ./requirements.txt /app/requirements.txt
|
8 |
+
|
9 |
+
# Install dependencies
|
10 |
+
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
11 |
+
RUN apt update && apt install -y ffmpeg
|
12 |
|
13 |
# Add and configure the user
|
14 |
RUN useradd -m -u 1000 user
|
15 |
|
16 |
# Set environment variables for the user
|
17 |
ENV HOME=/home/user \
|
18 |
+
PATH=/home/user/.local/bin:$PATH
|
|
|
19 |
|
20 |
# Set the user and working directory
|
21 |
USER user
|
|
|
30 |
# Set additional environment variables
|
31 |
ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/
|
32 |
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
|
33 |
+
ENV HOME=/home/user
|
34 |
ENV PATH="/opt/venv/bin:$PATH"
|
35 |
|
36 |
# Set the command to run the application
|