Spaces:
Sleeping
Sleeping
File size: 797 Bytes
845e0fe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # Use a lightweight Python base image
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Create a non-root user (Security best practice & required by some HF environments)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Copy requirements first to leverage Docker cache
COPY --chown=user requirements.txt requirements.txt
# Install dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application files
COPY --chown=user app.py app.py
COPY --chown=user navy_acronyms_clean.json navy_acronyms_clean.json
# Expose the port Hugging Face expects
EXPOSE 7860
# Run Streamlit on Port 7860
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] |