Spaces:
Running
Running
File size: 917 Bytes
917a5e4 0b960c9 4912057 32264a6 0b960c9 917a5e4 a2d357b 8935d92 32264a6 8935d92 a2d357b 917a5e4 |
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 28 29 30 31 32 33 34 |
FROM python:3.10-slim
WORKDIR /app
# This ensures models are cached properly and don’t re-download every time
RUN mkdir /.cache && chmod 777 /.cache
ENV TRANSFORMERS_CACHE=/.cache
ENV HF_HOME=/.cache
# Optional: Set default values for API configuration
# ENV AIBOM_USE_INFERENCE=true
# ENV AIBOM_CACHE_DIR=/.cache
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all application files (including setup.py)
COPY . /app
# Creates a directory called "output" inside application directory, sets permissions so that the application can write files to this directory
# RUN mkdir -p /app/output && chmod 777 /app/output
# Install the package in development mode
RUN pip install -e .
# Set environment variables
ENV PYTHONPATH=/app
# Create entrypoint script
RUN chmod +x /app/entrypoint.sh
# Command to run the application
ENTRYPOINT ["/app/entrypoint.sh"]
|