EDQP_Acronyms / Dockerfile
NavyDevilDoc's picture
Create Dockerfile
845e0fe verified
raw
history blame contribute delete
797 Bytes
# 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"]