ddgs / Dockerfile
motsobelal's picture
Update Dockerfile
2bce1f5 verified
raw
history blame contribute delete
759 Bytes
# Use Python 3.11 slim image as base
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PIP_NO_CACHE_DIR=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PYTHONPATH=/app
# Install system dependencies including curl for healthcheck
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y curl \
&& rm -rf /var/lib/apt/lists/*
# Copy application code
COPY . .
# Install Python dependencies (including API dependencies)
RUN pip install --no-cache-dir -e .[api]
# Expose port
EXPOSE 7860
# Create non-root user
RUN useradd --create-home --shell /bin/bash app \
&& chown -R app:app /app
USER app
# Run the application
CMD ["python", "start_api.py"]