Spaces:
Sleeping
Sleeping
Commit
·
81038f1
1
Parent(s):
73574a2
update Dockerfile
Browse files- Dockerfile +17 -25
Dockerfile
CHANGED
|
@@ -1,43 +1,35 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
# Set environment to noninteractive to avoid prompts during package installation
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
|
| 6 |
-
# Install
|
| 7 |
-
RUN apt-get update && apt-get install -y \
|
| 8 |
-
|
| 9 |
-
python3-pip \
|
| 10 |
texlive-latex-base \
|
| 11 |
texlive-fonts-recommended \
|
| 12 |
-
texlive-fonts-extra \
|
| 13 |
texlive-latex-recommended \
|
| 14 |
texlive-xetex \
|
| 15 |
-
texlive-luatex \
|
| 16 |
lmodern \
|
| 17 |
-
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
COPY . /app
|
| 23 |
-
|
| 24 |
-
RUN pip install --no-cache-dir --upgrade pip \
|
| 25 |
-
&& pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
| 26 |
-
|
| 27 |
-
# Set up a new user named "user" with user ID 1000
|
| 28 |
RUN useradd -m -u 1000 user
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
USER user
|
| 32 |
-
|
| 33 |
-
# Set home to the user's home directory
|
| 34 |
ENV HOME=/home/user \
|
| 35 |
-
PATH
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
# Set
|
| 38 |
WORKDIR $HOME/app
|
| 39 |
|
| 40 |
-
# Copy
|
| 41 |
COPY --chown=user . $HOME/app
|
| 42 |
|
|
|
|
|
|
|
|
|
|
| 43 |
CMD ["streamlit", "run", "app.py", "--server.port", "8200"]
|
|
|
|
| 1 |
+
FROM python:3.11
|
| 2 |
|
|
|
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
+
build-essential \
|
|
|
|
| 8 |
texlive-latex-base \
|
| 9 |
texlive-fonts-recommended \
|
|
|
|
| 10 |
texlive-latex-recommended \
|
| 11 |
texlive-xetex \
|
|
|
|
| 12 |
lmodern \
|
| 13 |
+
curl \
|
| 14 |
+
git \
|
| 15 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
+
# Create non-root user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
RUN useradd -m -u 1000 user
|
| 19 |
|
| 20 |
+
# Set environment variables
|
|
|
|
|
|
|
|
|
|
| 21 |
ENV HOME=/home/user \
|
| 22 |
+
PATH="/home/user/.local/bin:$PATH"
|
| 23 |
+
|
| 24 |
+
USER user
|
| 25 |
|
| 26 |
+
# Set working directories
|
| 27 |
WORKDIR $HOME/app
|
| 28 |
|
| 29 |
+
# Copy app files and install Python requirements
|
| 30 |
COPY --chown=user . $HOME/app
|
| 31 |
|
| 32 |
+
RUN python3 -m pip install --no-cache-dir --upgrade pip \
|
| 33 |
+
&& pip install --no-cache-dir -r requirements.txt
|
| 34 |
+
|
| 35 |
CMD ["streamlit", "run", "app.py", "--server.port", "8200"]
|