optimize: use pre-built PyTorch base image for worker to reduce build overhead
Build and Push Docker Images / build (api) (push) Successful in 1m52s
Details
Build and Push Docker Images / build (web) (push) Successful in 2m17s
Details
Build and Push Docker Images / build (worker) (push) Successful in 11m26s
Details
Build and Push Docker Images / deploy (push) Failing after 2m25s
Details
Build and Push Docker Images / build (api) (push) Successful in 1m52s
Details
Build and Push Docker Images / build (web) (push) Successful in 2m17s
Details
Build and Push Docker Images / build (worker) (push) Successful in 11m26s
Details
Build and Push Docker Images / deploy (push) Failing after 2m25s
Details
This commit is contained in:
parent
39abc55f05
commit
fd931f1cfc
|
|
@ -1,6 +1,10 @@
|
||||||
FROM python:3.11-slim
|
# Use pre-built PyTorch image to avoid massive downloads and build overhead
|
||||||
|
FROM pytorch/pytorch:2.1.1-cuda12.1-cudnn8-runtime
|
||||||
|
|
||||||
# Install system dependencies required by rasterio and other packages
|
# Set non-interactive for apt
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Install system dependencies and clean up in one layer
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
libexpat1 \
|
libexpat1 \
|
||||||
libgomp1 \
|
libgomp1 \
|
||||||
|
|
@ -10,6 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
libspatialindex-dev \
|
libspatialindex-dev \
|
||||||
libcurl4-openssl-dev \
|
libcurl4-openssl-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
@ -17,10 +22,13 @@ WORKDIR /app
|
||||||
# Set Python path to include /app
|
# Set Python path to include /app
|
||||||
ENV PYTHONPATH=/app
|
ENV PYTHONPATH=/app
|
||||||
|
|
||||||
|
# Copy requirements and install dependencies
|
||||||
|
# We use --no-cache-dir to keep the image small
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy the application code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Start the RQ worker to listen for jobs on the geocrop_tasks queue
|
# Start the RQ worker
|
||||||
CMD ["python", "worker.py", "--worker"]
|
CMD ["python", "worker.py", "--worker"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue