File size: 836 Bytes
2961758 1efe64c 2961758 1efe64c 3c397fd 1efe64c 2961758 3c397fd d130b8e 2961758 d130b8e 2961758 1efe64c 3c397fd 2961758 3c397fd 1efe64c 2961758 3c397fd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# Use a lightweight Python base image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Create and set permissions for COMET cache directory
RUN mkdir -p /tmp && chmod 777 /tmp
# Copy the project files
COPY . .
# Install system dependencies (optional – useful for some Python packages)
RUN apt-get update && apt-get install -y \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir unbabel-comet
# Environment variables
ENV COMET_CACHE="/tmp"
# Expose port for Gradio
EXPOSE 7860
# Set environment variables
ENV OPENAI_API_KEY=${OPENAI_API_KEY}
ENV HF_API_TOKEN=${HF_API_TOKEN}
ENV COMET_CACHE="/tmp"
# Run the Gradio interface
CMD ["python", "interface.py"] |