Spaces:
Sleeping
Sleeping
File size: 872 Bytes
ce47c87 |
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 |
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir torch transformers
# Install supervisor to manage multiple processes
RUN apt-get update && apt-get install -y supervisor \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the application code
COPY . .
# Expose the necessary ports
EXPOSE 8501 8502
# Create a supervisor configuration file
RUN mkdir -p /etc/supervisor/conf.d/
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Command to start supervisor
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|