File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change 11FROM python:3.11-alpine3.17 AS builder
22
3- # Set working directory
43WORKDIR /usr/src/app
54
6- # Install build dependencies
75RUN apk add --no-cache --virtual .build-deps \
86 gcc musl-dev libffi-dev
97
10- # Install Python dependencies
118COPY requirements.txt .
9+
1210RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
1311
14- # Final lightweight runtime image
1512FROM python:3.11-alpine3.17
1613
1714WORKDIR /usr/src/app
1815
19- # Create non-root user
2016RUN addgroup -S app && adduser -S app -G app
2117USER app
2218
23- # Copy installed dependencies from builder
2419COPY --from=builder /install /usr/local
2520
26- # Copy app source
2721COPY . .
2822
2923EXPOSE 3000
3024
31- # Use exec form to prevent shell issues
3225CMD ["python" , "app.py" ]
You can’t perform that action at this time.
0 commit comments