Fixed missing gcc env for macOS in Dockerfile
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -1,18 +1,25 @@
|
|||||||
# Stage 1: Build
|
# Stage 1: Build
|
||||||
FROM python:3.12-slim-bookworm as builder
|
FROM python:3.12-slim-bookworm as builder
|
||||||
|
|
||||||
|
# Install build dependencies (gcc, Python headers, etc.)
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
gcc \
|
||||||
|
python3-dev \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy only the requirements file to take advantage of Docker's caching
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
# Install Python dependencies
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Stage 2: Runtime
|
# Stage 2: Runtime
|
||||||
FROM python:3.12-slim-bookworm
|
FROM python:3.12-slim-bookworm
|
||||||
|
|
||||||
# Install system dependencies (if any are needed)
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
&& apt-get clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user