suka / Dockerfile
grkavi0912's picture
Upload Dockerfile with huggingface_hub
db99a17 verified
raw
history blame contribute delete
867 Bytes
# syntax=docker/dockerfile:1
# Use a lightweight Python image
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy Flask app, model file, and Streamlit app
# Assuming these files are located at the root of the uploaded content
COPY app.py .
COPY random_forest_pipeline.joblib .
COPY streamlit_app.py .
# Expose ports (Flask via Gunicorn, Streamlit)
EXPOSE 5000
EXPOSE 8501
# Start Flask (Gunicorn) and Streamlit together
# Make sure the module path matches the Flask app location (app:product_sales_api)
# and the Streamlit app file name (streamlit_app.py)
CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:5000 app:product_sales_api & streamlit run streamlit_app.py --server.port 8501 --server.enableCORS false --server.enableXsrfProtection false"]