# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

# Use the official Python 3.11 slim image as the base image
FROM python:3.11-slim

# Set the default language environment variable
ENV LANG=C.UTF-8

# Define a build argument for architecture (default is "cpu")
ARG ARCH="cpu"

# Update the package list and install necessary packages
RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing build-essential 
    
# Create a directory for the application
RUN mkdir -p /home/user

# Copy the application code and requirements file to the container
COPY ./gradio/docsum_ui_gradio.py /home/user/docsum_ui_gradio.py
COPY ./gradio/requirements.txt /home/user/requirements.txt 

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip setuptools && \
    pip install --no-cache-dir -r /home/user/requirements.txt

# Set the working directory
WORKDIR /home/user/

# Expose the port that the application will run on
EXPOSE 5173

# Define the command to run the application
CMD ["python", "docsum_ui_gradio.py"]
