From 5f4ad9279cb3cc7aa472d7c508acc69339999c4d Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 27 Sep 2024 09:48:15 +0300 Subject: [PATCH] dockerfile-onestage --- Dockerfile | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4131aa0..a3f735f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# Stage 1: Build stage -FROM python:slim AS builder +# Use a single stage +FROM python:slim WORKDIR /app @@ -11,18 +11,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends gcc libffi-dev # Install Python dependencies including redis with hiredis support RUN pip install --no-cache-dir -r requirements.txt -# Stage 2: Final stage -FROM python:slim - -WORKDIR /app - -# Copy only necessary files from the builder stage -COPY --from=builder /usr/local/lib/python3.*/dist-packages /usr/local/lib/python3.*/dist-packages - COPY . . -RUN pip install redis[hiredis] - EXPOSE 8080 CMD ["python", "main.py"] \ No newline at end of file