Merge pull request #4 from BigDaddyAman/deps-update

Updated dependencies (boto3 → 1.40.33)

Upgraded pip, setuptools, wheel in Docker build

Refactored Dockerfile to multi-stage for smaller runtime image
This commit is contained in:
Aman 2025-09-18 14:32:29 +08:00 committed by GitHub
commit 00b29ea012
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 4 deletions

View File

@ -1,14 +1,24 @@
FROM python:3.12-slim AS builder
RUN apt-get update && \
apt-get install -y gcc libpq-dev && \
rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip setuptools wheel
COPY requirements.txt /app/requirements.txt
RUN pip install --prefix=/install -r /app/requirements.txt
FROM python:3.12-slim FROM python:3.12-slim
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y postgresql-client gcc libpq-dev gzip && \ apt-get install -y postgresql-client gzip && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/requirements.txt COPY --from=builder /install /usr/local
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY main.py /app/main.py COPY main.py /app/main.py
WORKDIR /app WORKDIR /app
CMD ["python", "main.py"] CMD ["python", "main.py"]