# Use a lightweight Python base image
FROM python:3.11-slim
# Create and set work directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy project source
COPY . /app
# Install Python dependencies if present
RUN if [ -f requirements.txt ]; then \
python -m pip install --no-cache-dir -r requirements.txt; \
fi
# Build from source if setup.py is present
RUN if [ -f setup.py ]; then \
python -m pip install --no-cache-dir .; \
fi
# Expose common Taiga ports for convenience
EXPOSE 8000 9000
# Default command: run a simple Python version check to verify the image works
CMD ["python", "-V"]