playwebit-t5-api / Dockerfile
mike23415's picture
Update Dockerfile
6a0670c verified
raw
history blame
710 Bytes
# Use an official Python runtime as a parent image
FROM python:3.9
# Set the working directory inside the container
WORKDIR /app
# Set environment variables to configure cache location
ENV TRANSFORMERS_CACHE=/tmp/cache
RUN mkdir -p /tmp/cache && chmod 777 /tmp/cache
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY . .
# Expose the port for running the app (modify if needed)
EXPOSE 7860
# Run the application
CMD ["python", "app.py"]