Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/Services/AIService/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
&& rm -rf /var/lib/apt/lists/*

# Copy requirements first for better caching
# Build context should be the AIService directory (where Dockerfile is located)
COPY requirements.txt .
COPY requirements-dev.txt .

Expand Down Expand Up @@ -75,6 +74,15 @@
sentence-transformers==3.0.0 && \
echo "=== All dependencies installed successfully ==="

RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-cache-dir \
--timeout=300 \
--retries=5 \
--verbose \
--progress-bar=on \
-r requirements.txt && \
echo "=== requirements.txt installed successfully ==="

# Runtime stage
FROM python:3.11-slim

Expand All @@ -90,7 +98,6 @@
COPY --from=builder /usr/local/bin /usr/local/bin

# Copy application code
# Build context is expected to be the repo root, but if it's the AIService directory, use relative path
COPY app ./app
COPY requirements.txt ./
# COPY proto ./proto
Expand All @@ -109,5 +116,5 @@

# Run application
# Use PORT environment variable if set, otherwise default to 8000
CMD sh -c "uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000}"

Check warning on line 119 in src/Services/AIService/Dockerfile

View workflow job for this annotation

GitHub Actions / build (rosie91/stemify:ai-service, src/Services/AIService, src/Services/AIService)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/