chore: migrate to python 3.13 and update dependencies
Migrate from Python 3.11 to 3.13 with updated dependencies. Switch from PyPDF2 to pypdf library for better PDF processing. Add new U14 age groups and extract-pdf utility script.
This commit is contained in:
+10
-8
@@ -1,5 +1,5 @@
|
||||
# Multi-stage build to create a distroless image
|
||||
FROM python:3.11 AS builder
|
||||
FROM python:3.13 AS builder
|
||||
|
||||
# Install poetry and the export plugin
|
||||
# RUN pip install poetry poetry-plugin-export
|
||||
@@ -7,17 +7,21 @@ FROM python:3.11 AS builder
|
||||
# Create working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy dependency files
|
||||
COPY requirements.txt ./
|
||||
|
||||
# Export dependencies to requirements.txt
|
||||
# RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
|
||||
|
||||
# Copy dependency files
|
||||
COPY requirements.txt ./
|
||||
|
||||
# Install dependencies to a target directory that we can copy to the distroless image
|
||||
RUN pip install --no-cache-dir --target=/app/site-packages -r requirements.txt
|
||||
|
||||
# Create distroless image
|
||||
FROM gcr.io/distroless/python3-debian12
|
||||
FROM python:3.13-slim
|
||||
|
||||
# RUN apt update \
|
||||
# && apt -y upgrade \
|
||||
# && apt clean \
|
||||
# && rm /var/lib/apt/lists/* || true
|
||||
|
||||
# Copy installed packages and application from builder stage
|
||||
COPY --from=builder /app/site-packages /app/site-packages
|
||||
@@ -35,7 +39,5 @@ WORKDIR /app
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
USER nonroot
|
||||
|
||||
# Run the application directly with Python using the distroless entrypoint
|
||||
ENTRYPOINT ["/usr/bin/python3", "-m", "uvicorn", "myice.webapi:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
|
||||
Reference in New Issue
Block a user