Skip to content

Commit 10aaf87

Browse files
authored
Update Dockerfile
1 parent af7d183 commit 10aaf87

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Dockerfile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ FROM python:3.10-slim AS builder
55

66
WORKDIR /app
77

8-
# Install system dependencies
8+
# Install build dependencies
99
RUN 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
1414
COPY ../.. /app
1515

16-
# Install Python dependencies into a wheel folder
16+
# Install Python dependencies into wheels for caching
1717
RUN pip install --upgrade pip
1818
RUN pip wheel --no-cache-dir --wheel-dir /app/wheels -r requirements.txt
1919

@@ -26,21 +26,23 @@ FROM python:3.10-slim
2626

2727
WORKDIR /app
2828

29-
# Add a non-root system user for security
29+
# Create non-root user for security
3030
RUN useradd -m appuser
3131
USER appuser
3232

33-
# Copy wheels built in stage 1
33+
# Copy built wheels and project source
3434
COPY --from=builder /app/wheels /wheels
3535
COPY --from=builder /app /app
36+
37+
# Install wheels
3638
RUN 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
4244
HEALTHCHECK --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

Comments
 (0)