@@ -5,15 +5,15 @@ FROM python:3.10-slim AS builder
55
66WORKDIR /app
77
8- # Install system dependencies
8+ # Install build dependencies
99RUN apt-get update && apt-get install -y --no-install-recommends \
1010 build-essential gcc \
1111 && rm -rf /var/lib/apt/lists/*
1212
13- # Copy project files
13+ # Copy project code into image
1414COPY ../.. /app
1515
16- # Install Python dependencies into a wheel folder
16+ # Install Python dependencies into wheels for caching
1717RUN pip install --upgrade pip
1818RUN pip wheel --no-cache-dir --wheel-dir /app/wheels -r requirements.txt
1919
@@ -26,21 +26,23 @@ FROM python:3.10-slim
2626
2727WORKDIR /app
2828
29- # Add a non-root system user for security
29+ # Create non-root user for security
3030RUN useradd -m appuser
3131USER appuser
3232
33- # Copy wheels built in stage 1
33+ # Copy built wheels and project source
3434COPY --from=builder /app/wheels /wheels
3535COPY --from=builder /app /app
36+
37+ # Install wheels
3638RUN pip install --no-cache /wheels/*
3739
3840# Expose service port
39- EXPOSE 8003
41+ EXPOSE 8002
4042
41- # Healthcheck for container orchestration
43+ # Kubernetes/Docker Healthcheck
4244HEALTHCHECK --interval=10s --timeout=3s \
43- CMD curl -f http://localhost:8003 /docs || exit 1
45+ CMD curl -f http://localhost:8002 /docs || exit 1
4446
45- # Start FastAPI service
46- CMD ["uvicorn" , "src.driver-location- service.main:app" , "--host" , "0.0.0.0" , "--port" , "8003 " ]
47+ # Start Dispatch FastAPI service
48+ CMD ["uvicorn" , "src.dispatch- service.main:app" , "--host" , "0.0.0.0" , "--port" , "8002 " ]
0 commit comments