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

Image build is optimized.

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