Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KNIGHT
Asyst Moodle Plugin
Commits
bdd84d73
Commit
bdd84d73
authored
Jan 03, 2025
by
Artem Baranovskyi
Browse files
Image build is optimized.
parent
a4af2fc5
Pipeline
#10677
failed with stages
in 10 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
bdd84d73
...
@@ -12,36 +12,40 @@
...
@@ -12,36 +12,40 @@
stages
:
stages
:
-
build
-
build
-
test
-
deploy
-
deploy
variables
:
variables
:
DOCKER_DRIVER
:
overlay2
DOCKER_DRIVER
:
overlay2
DOCKER_TLS_CERTDIR
:
"
"
DOCKER_TLS_CERTDIR
:
"
"
DOCKER_HOST
:
"
unix:///var/run/docker.sock"
DOCKER_HOST
:
"
unix:///var/run/docker.sock"
DOCKER_OPTS
:
"
--data-root=/mnt/volume/docker-data"
build
:
build
:
stage
:
build
stage
:
build
image
:
docker:latest
image
:
docker:latest
services
:
services
:
-
docker:dind
-
name
:
docker:dind:20.10.21
script
:
command
:
[
"
--tls=false"
,
"
--storage-driver=overlay2"
,
"
--mtu=1500"
,
"
--data-root=/mnt/volume"
]
-
docker build -t flask-backend flask_ml_api
test
:
stage
:
test
image
:
python:3.11-slim
before_script
:
before_script
:
-
python -m venv venv
-
mkdir -p /mnt/volume
-
source venv/bin/activate
-
mount /dev/vdb /mnt/volume || echo "Failed to mount /dev/vdb"
-
pip install -r requirements.txt
-
export DOCKER_TMPDIR=/mnt/volume
-
docker system prune -a -f --volumes ||
true
-
df -h
after_script
:
-
docker system prune -a -f
-
docker volume prune -f
script
:
script
:
-
pytest tests/
-
docker build --no-cache --progress=plain -t flask-backend-full -f flask_ml_api/Dockerfile .
cache
:
key
:
build-cache
paths
:
-
/mnt/volume
timeout
:
1h
deploy
:
deploy
:
stage
:
deploy
stage
:
deploy
image
:
docker:latest
dependencies
:
services
:
-
build
-
docker:dind
script
:
script
:
-
docker
-compose up -d
-
docker
run -d flask-backend-full
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment