Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +34 -36
Dockerfile
CHANGED
@@ -1,36 +1,34 @@
|
|
1 |
-
# Use the official Python image from the Docker Hub
|
2 |
-
FROM python:3.10
|
3 |
-
|
4 |
-
# Install system dependencies
|
5 |
-
RUN apt-get update && \
|
6 |
-
apt-get install -y \
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
#
|
30 |
-
|
31 |
-
|
32 |
-
#
|
33 |
-
|
34 |
-
|
35 |
-
# Start the streamlit app on 7860
|
36 |
-
CMD ["streamlit", "run", "app.py"]
|
|
|
1 |
+
# Use the official Python image from the Docker Hub
|
2 |
+
FROM python:3.10
|
3 |
+
|
4 |
+
# Install system dependencies
|
5 |
+
RUN apt-get update && \
|
6 |
+
apt-get install -y poppler-utils && \
|
7 |
+
rm -rf /var/lib/apt/lists/*
|
8 |
+
|
9 |
+
# Set up the working directory
|
10 |
+
WORKDIR /code
|
11 |
+
|
12 |
+
# Copy the current directory contents into the container
|
13 |
+
COPY requirements.txt /code/requirements.txt
|
14 |
+
|
15 |
+
# Install the requirements from the requirements.txt
|
16 |
+
RUN pip install --no-cache-dir -r /code/requirements.txt
|
17 |
+
|
18 |
+
# Create a new user and switch to it
|
19 |
+
RUN useradd -m user
|
20 |
+
USER user
|
21 |
+
|
22 |
+
# Set the environment variables for the user's home and path
|
23 |
+
ENV HOME=/home/user \
|
24 |
+
PATH=$HOME/.local/bin:$PATH
|
25 |
+
|
26 |
+
# Set the working directory to the user's home directory
|
27 |
+
WORKDIR $HOME/app
|
28 |
+
|
29 |
+
# Copy the current directory contents into the container's $HOME/app folder, setting owner to user
|
30 |
+
COPY --chown=user . $HOME/app
|
31 |
+
|
32 |
+
# Start the Streamlit app
|
33 |
+
CMD ["streamlit", "run", "app.py"]
|
34 |
+
|
|
|
|