Commit a4af2fc5 authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Image build is optimized.

parent 54121ad1
Pipeline #10676 failed with stages
in 9 seconds
......@@ -12,6 +12,7 @@
stages:
- build
- test
- deploy
variables:
......@@ -23,25 +24,24 @@ build:
stage: build
image: docker:latest
services:
- name: docker:dind
command: ["--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"]
- docker:dind
script:
- docker build -t flask-backend flask_ml_api
test:
stage: test
image: python:3.11-slim
before_script:
- mkdir -p /mnt/volume
- mount /dev/vdb /mnt/volume || echo "Already mounted"
- export DOCKER_TMPDIR=/mnt/volume
- docker system prune -a -f --volumes || true
- df -h
- python -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt
script:
- docker build --no-cache --progress=plain -t flask-backend-full -f flask_ml_api/Dockerfile .
cache:
key: build-cache
paths:
- /mnt/volume
timeout: 1h
- pytest tests/
deploy:
stage: deploy
dependencies:
- build
image: docker:latest
services:
- docker:dind
script:
- docker run -d flask-backend-full
- docker-compose up -d
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