From 4c7a089753026cda3ef192b1e1f4f815ffd9b7da Mon Sep 17 00:00:00 2001 From: Simon Diesenreiter Date: Sat, 4 Apr 2026 20:29:07 +0200 Subject: [PATCH] fix: proper containerfile, refs NOISSUE --- Containerfile | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/Containerfile b/Containerfile index 0f6161f..c380c61 100644 --- a/Containerfile +++ b/Containerfile @@ -1,6 +1,43 @@ -FROM alpine +# AI Software Factory Dockerfile +FROM python:3.11-slim +# Set environment variables +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + PIP_NO_CACHE_DIR=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=1 + +# Set work directory WORKDIR /app -COPY ./ai_software_factory/* /app -CMD ["python", "/app/main.py"] +# Install system dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + && rm -rf /var/lib/apt/lists/* + +# Install dependencies +COPY ./ai_software_factory/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY ./ai_software_factory . + +# Set up environment file if it exists, otherwise use .env.example +# RUN if [ -f .env ]; then \ +# cat .env; \ +# elif [ -f .env.example ]; then \ +# cp .env.example .env; \ +# fi + +# Initialize database tables (use SQLite by default, can be overridden by DB_POOL_SIZE env var) +RUN python database.py || true + +# Expose port +EXPOSE 8000 + +# Health check +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD curl -f http://localhost:8000/health || exit 1 + +# Run application +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]"]