Commit 22846c84 authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Image build is optimized.

parent 0868c4dc
Pipeline #10604 failed with stage
in 1 minute and 2 seconds
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
FROM python:3.10-alpine AS builder FROM python:3.10-alpine AS builder
# Install system dependencies # Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apk add --no-cache \
build-essential \ build-base \
python3-venv \ python3-dev \
&& rm -rf /var/lib/apt/lists/* py3-virtualenv
# Create and activate virtual environment # Create and activate virtual environment
RUN python3 -m venv /opt/myenv RUN python3 -m venv /opt/myenv
...@@ -32,11 +32,10 @@ RUN /opt/myenv/bin/pip install sentence_transformers && \ ...@@ -32,11 +32,10 @@ RUN /opt/myenv/bin/pip install sentence_transformers && \
RUN /opt/myenv/bin/pip install --upgrade setuptools wheel RUN /opt/myenv/bin/pip install --upgrade setuptools wheel
# Final image # Final image
FROM python:3.10-slim FROM python:3.10-alpine
# Install system dependencies # Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apk add --no-cache
&& rm -rf /var/lib/apt/lists/*
# Copy virtual environment and application from build stage # Copy virtual environment and application from build stage
COPY --from=builder /opt/myenv /opt/myenv COPY --from=builder /opt/myenv /opt/myenv
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment