image-caption / Dockerfile
AnkitS1997's picture
first commit
ce47c87
raw
history blame
872 Bytes
# 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"]