CaptionGenerator / Dockerfile
z2learn's picture
Create Dockerfile
f6fe243 verified
Raw
History Blame Contribute Delete
737 Bytes
# -------------- Dockerfile --------------
# Use a lightweight Python base image
FROM python:3.10-slim
# Set a working directory inside the container
WORKDIR /app
# Copy only requirements first (to leverage Docker cache)
COPY requirements.txt .
# Upgrade pip and install Python dependencies
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy the application code into the container
COPY app.py .
# Expose the port that Gradio will listen on
EXPOSE 7860
# Set environment variables so Gradio binds to 0.0.0.0 (all interfaces)
ENV GRADIO_SERVER_NAME="0.0.0.0"
ENV GRADIO_SERVER_PORT="7860"
# Start the Gradio app
CMD ["python", "app.py"]
# -------------- End of Dockerfile --------------