freeleaps-service-hub/apps/devops/Dockerfile

31 lines
728 B
Docker

FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Set environment variables
ENV LOG_BASE_PATH=/app/log/devops
# Create necessary directories
RUN mkdir -p /app/log/devops
# Expose port
EXPOSE 8014
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8014/api/_/healthz || exit 1
# Start the application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8014", "--reload"]