Update Dockerfile
Browse files- Dockerfile +12 -13
Dockerfile
CHANGED
@@ -1,28 +1,27 @@
|
|
1 |
FROM python:3.10.9
|
2 |
|
3 |
-
|
4 |
-
RUN useradd -m -u 1000 user
|
5 |
|
6 |
-
|
7 |
-
USER user
|
8 |
|
9 |
-
|
|
|
|
|
|
|
|
|
10 |
ENV HOME=/home/user \
|
11 |
-
|
12 |
|
13 |
-
# Set the working directory to the user's home directory
|
14 |
WORKDIR $HOME/app
|
15 |
|
16 |
-
# Upgrade pip
|
17 |
-
RUN pip install --no-cache-dir --upgrade pip
|
18 |
-
|
19 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
20 |
COPY --chown=user . $HOME/app
|
21 |
|
22 |
# Set environment variables
|
23 |
ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/
|
24 |
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
|
|
|
25 |
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
|
26 |
|
27 |
-
|
28 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
FROM python:3.10.9
|
2 |
|
3 |
+
WORKDIR /
|
|
|
4 |
|
5 |
+
COPY ./requirements.txt /code/requirements.txt
|
|
|
6 |
|
7 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
+
RUN apt update && apt install -y ffmpeg
|
9 |
+
|
10 |
+
RUN useradd -m -u 1000 user
|
11 |
+
USER user
|
12 |
ENV HOME=/home/user \
|
13 |
+
PATH=/home/user/.local/bin:$PATH
|
14 |
|
|
|
15 |
WORKDIR $HOME/app
|
16 |
|
|
|
|
|
|
|
|
|
17 |
COPY --chown=user . $HOME/app
|
18 |
|
19 |
# Set environment variables
|
20 |
ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/
|
21 |
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
|
22 |
+
ENV HOME=/home/appuser
|
23 |
ENV PATH="/opt/venv/bin:$PATH"
|
24 |
+
RUN chmod -R 777 /home/appuser
|
25 |
+
RUN chmod -R 777 $HOME/app
|
26 |
|
27 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|