test / Dockerfile
mashe's picture
Update Dockerfile
16067a8 verified
raw
history blame
985 Bytes
# Use an official Python runtime as a parent image
FROM python:3.9
# Install CUDA for GPU support (optional, based on your needs)
# Uncomment the following lines if you need GPU support
# RUN apt-get update && apt-get install -y --no-install-recommends \
# cuda-cudart-dev-11.0 \
# && \
# rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Make port 7860 available to the world outside this container
EXPOSE 7860
# Define environment variable for Gradio server port
ENV GRADIO_SERVER_PORT=7860
# Set the TRANSFORMERS_CACHE environment variable
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub
# Create the cache directory if it doesn't exist
RUN mkdir -p $TRANSFORMERS_CACHE
# Run app.py when the container launches
CMD ["python", "app.py"]