Commit 3dd03cce authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Image build is optimized.

parent 55017a5d
......@@ -12,23 +12,36 @@
stages:
- build
- test
- deploy
variables:
DOCKER_BUILDKIT: 1
BUILDKIT_INLINE_CACHE: 1
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: "unix:///var/run/docker.sock"
build:
stage: build
image: docker:24
image: docker:latest
services:
- docker:24-dind
- docker:dind
script:
- docker build -t flask-backend flask_ml_api
test:
stage: test
image: python:3.10-slim
before_script:
- export DOCKER_TMPDIR=/mnt/volume
- python -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt
script:
# - docker build --no-cache --pull --progress=plain -t flask-backend -f Dockerfile .
- docker build --no-cache --pull --progress=plain -t flask-backend -f Dockerfile.test .
cache:
key: build-cache
paths:
- /mnt/volume
- pytest tests/
deploy:
stage: deploy
image: docker:latest
services:
- docker:dind
script:
- 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