File size: 559 Bytes
58cc2ea 86692fd 58cc2ea 86692fd 58cc2ea 86692fd a1ef2ea 86692fd aa10519 86692fd aa10519 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
FROM python:3.9
# Set work directory
WORKDIR /code
# Install dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy application code
COPY ./app /code/app
# Create and set permissions for the cache directory
RUN mkdir -p /code/app/cache && chmod -R 777 /code/app/cache
# Set environment variable for Transformers cache
ENV TRANSFORMERS_CACHE=/code/app/cache
# Expose port
EXPOSE 7860
# Start application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |