Skip to content

Commit

Permalink
Updated code
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Dec 4, 2023
1 parent 2e26092 commit 9cef9b9
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions examples/kubernetes-tilt-dev/apps/python-fastapi-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,9 @@ COPY requirements*.txt ./
# Install development dependencies
RUN pip install --no-cache-dir -r requirements.dev.txt

# Stage 2: Build production dependencies
FROM python:3.12.0-alpine AS builder-prod

WORKDIR /code

# Copy production requirements file
COPY requirements.txt ./

# Install production dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Stage 2: Build development dependencies and run the application in development mode
FROM builder-dev AS development

# Copy development dependencies from builder-dev stage
COPY --from=builder-dev /usr/local /usr/local

# Copy the application code
COPY ./app ./app

Expand All @@ -37,7 +24,18 @@ USER nonroot
# Command to run the application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80", "--reload"]

# Stage 3: Final image
# Stage 3: Build production dependencies
FROM python:3.12.0-alpine AS builder-prod

WORKDIR /code

# Copy production requirements file
COPY requirements.txt ./

# Install production dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Stage 4: Final image
FROM python:3.12.0-alpine as production

WORKDIR /code
Expand Down

0 comments on commit 9cef9b9

Please sign in to comment.