Update Dockerfile
Browse files- Dockerfile +9 -1
Dockerfile
CHANGED
|
@@ -1,12 +1,20 @@
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
|
|
|
| 3 |
RUN useradd -m -u 1000 user
|
| 4 |
USER user
|
|
|
|
|
|
|
| 5 |
ENV PATH="/home/user/.local/bin:$PATH"
|
| 6 |
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
|
|
|
|
| 9 |
COPY --chown=user . /app
|
|
|
|
|
|
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
| 3 |
+
# Create a user to avoid running as root
|
| 4 |
RUN useradd -m -u 1000 user
|
| 5 |
USER user
|
| 6 |
+
|
| 7 |
+
# Add Python bin path to environment
|
| 8 |
ENV PATH="/home/user/.local/bin:$PATH"
|
| 9 |
|
| 10 |
+
# Set working directory
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
+
# Copy files
|
| 14 |
COPY --chown=user . /app
|
| 15 |
+
|
| 16 |
+
# Install dependencies
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
+
# Run Streamlit app on Hugging Face-required port (7860)
|
| 20 |
+
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|