please-work-thx / Dockerfile
danieaneta
update
a8bde12
# Base image
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Set environment variables for caches
ENV MPLCONFIGDIR=/app/matplotlib_cache
ENV HF_HOME=/app/transformers_cache
ENV HOME=/app
# Create and set permissions for directories
RUN mkdir -p /app/matplotlib_cache /app/transformers_cache && \
chmod -R 777 /app/matplotlib_cache /app/transformers_cache
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy your application files
COPY . .
# Command to run your application on a non-privileged port
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]