From 316341db9fa921e0cd7f76fccf7ace665eec635f Mon Sep 17 00:00:00 2001 From: Gourav Shah Date: Sun, 21 Sep 2025 11:31:35 +0530 Subject: [PATCH 1/3] Create Dockerfile Dockerfile added --- Dockerfile | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..330a4ff --- /dev/null +++ b/Dockerfile @@ -0,0 +1,54 @@ +# Multi-stage Dockerfile for Tech Stack Advisor ML App + +# Stage 1: Builder stage for training the model +FROM python:3.11-slim AS builder + +WORKDIR /app + +# Install build dependencies +RUN apt-get update && apt-get install -y \ + gcc \ + python3-dev \ + && rm -rf /var/lib/apt/lists/* + +# Copy requirements and install Python dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir --user -r requirements.txt + +# Copy training script and train the model +COPY train.py . +RUN python train.py + +# Stage 2: Production runtime stage +FROM python:3.11-slim AS production + +# Create non-root user for security +RUN useradd --create-home --shell /bin/bash mluser + +WORKDIR /app + +# Copy Python packages from builder stage +COPY --from=builder /root/.local /home/mluser/.local + +# Copy application files +COPY app.py . +COPY requirements.txt . + +# Copy trained model from builder stage +COPY --from=builder /app/model.pkl . +COPY --from=builder /app/encoders.pkl . + +# Set ownership and switch to non-root user +RUN chown -R mluser:mluser /app +USER mluser + +# Make sure scripts in .local are usable +ENV PATH=/home/mluser/.local/bin:$PATH + +# Add health check +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD python -c "import requests; requests.get('http://localhost:7860', timeout=3)" || exit 1 + +EXPOSE 7860 + +CMD ["python", "app.py"] From d8196d01e2916de53d4c57e96ba6ce15de10d02e Mon Sep 17 00:00:00 2001 From: Gourav Shah Date: Sun, 21 Sep 2025 11:42:40 +0530 Subject: [PATCH 2/3] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 330a4ff..ba02f9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Multi-stage Dockerfile for Tech Stack Advisor ML App - +# # Stage 1: Builder stage for training the model FROM python:3.11-slim AS builder From 8ddb32a3af34bd4a0b6adb38fdc9374e30e48f1b Mon Sep 17 00:00:00 2001 From: Gourav Shah Date: Sun, 21 Sep 2025 11:44:07 +0530 Subject: [PATCH 3/3] Update goose.yml gemini-2.5-flash --- .github/workflows/goose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/goose.yml b/.github/workflows/goose.yml index e8cd368..18896d3 100644 --- a/.github/workflows/goose.yml +++ b/.github/workflows/goose.yml @@ -48,7 +48,7 @@ jobs: mkdir -p ~/.config/goose cat > ~/.config/goose/config.yaml <<'EOF' GOOSE_PROVIDER: google - GOOSE_MODEL: gemini-2.0-flash-exp + GOOSE_MODEL: gemini-2.5-flash keyring: false EOF