Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +13 -22
Dockerfile
CHANGED
|
@@ -1,29 +1,20 @@
|
|
| 1 |
-
# Use the official Python base image
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Set working directory
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
COPY
|
| 13 |
-
|
| 14 |
-
# Install system dependencies
|
| 15 |
-
RUN apt-get update && apt-get install -y \
|
| 16 |
-
build-essential \
|
| 17 |
-
git \
|
| 18 |
-
curl \
|
| 19 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 20 |
-
|
| 21 |
-
# Install Python dependencies
|
| 22 |
-
RUN pip install --no-cache-dir --upgrade pip \
|
| 23 |
-
&& pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
CMD ["
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
+
FROM python:3.9
|
| 3 |
+
|
| 4 |
+
# Create a non-root user
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
+
USER user
|
| 7 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 8 |
|
| 9 |
# Set working directory
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
# Install dependencies
|
| 13 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 14 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
# Copy app files
|
| 17 |
+
COPY --chown=user . /app
|
| 18 |
|
| 19 |
+
# Start the app using Streamlit
|
| 20 |
+
CMD ["streamlit", "run", "app.py", "--server.address", "0.0.0.0", "--server.port", "7860"]
|