Commit 4911a6cb authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Image build is optimized.

parent df6dd85b
Pipeline #10895 failed with stages
in 2 minutes and 12 seconds
Showing with 3 additions and 4 deletions
+3 -4
......@@ -41,7 +41,8 @@ build:
- docker system prune -a -f
- docker volume prune -f
script:
- docker build --cache-from=asyst-nlp-grader --no-cache --progress=plain -t asyst-nlp-grader -f flask_ml_api/Dockerfile .
# - docker build --cache-from=asyst-nlp-grader --no-cache --progress=plain -t asyst-nlp-grader -f flask_ml_api/Dockerfile .
- docker buildx build --cache-from=type=registry,ref=22baar1mst/asyst-nlp-grader --no-cache --progress=plain -t 22baar1mst/asyst-nlp-grader:latest -f flask_ml_api/Dockerfile --push .
- docker push 22baar1mst/asyst-nlp-grader:latest
cache:
key: build-cache
......
......@@ -11,12 +11,10 @@ ENV PATH="/opt/myenv/bin:$PATH"
WORKDIR /app
COPY . /app
# Install dependencies in smaller steps
RUN pip install --no-cache-dir Flask matplotlib scikit-learn transformers pandas sentence_transformers
RUN pip install --no-cache-dir --upgrade setuptools wheel
# Final image
FROM python:3.10-slim
FROM python:3.10-slim AS final
COPY --from=builder /opt/myenv /opt/myenv
COPY --from=builder /app /app
......
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