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
ed62dd73
Commit
ed62dd73
authored
Jan 09, 2025
by
Artem Baranovskyi
Browse files
Image build is optimized.
parent
bdb6fce7
Pipeline
#10765
failed with stages
in 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
ed62dd73
...
...
@@ -31,6 +31,8 @@ before_script:
-
docker network prune -f ||
true
-
docker image prune -a -f ||
true
-
docker builder prune -f ||
true
-
apt-get update
-
apt-get install -y apt-utils
-
apt-get clean
-
rm -rf /var/lib/apt/lists/*
-
rm -rf /tmp/*
...
...
flask_ml_api/Dockerfile
View file @
ed62dd73
# Этап сборки
FROM
pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
as
build
# Установка Rust и Cargo
RUN
apt-get update
&&
apt-get
install
-y
curl
RUN
curl
--proto
'=https'
--tlsv1
.2
-sSf
https://sh.rustup.rs
-o
/usr/local/bin/rustup-init.sh
RUN
chmod
+x /usr/local/bin/rustup-init.sh
RUN
/usr/local/bin/rustup-init.sh
-y
--default-toolchain
none
# Добавление пути к rustup и cargo в переменную окружения PATH
ENV
PATH="$PATH:/root/.cargo/bin"
# Установка toolchain
RUN
/root/.cargo/bin/rustup toolchain
install
stable
--profile
minimal
--no-self-update
# Проверка установки Rust и Cargo
RUN
/root/.cargo/bin/rustup
--version
RUN
/root/.cargo/bin/cargo
--version
...
...
@@ -23,10 +28,12 @@ ENV PATH="/opt/myenv/bin:$PATH"
WORKDIR
/app
COPY
. /app
# Установка пакетов Python
RUN
pip
install
--no-cache-dir
Flask matplotlib scikit-learn transformers pandas sentence_transformers
&&
\
pip
install
--no-cache-dir
--upgrade
setuptools wheel
&&
\
rm
-rf
/root/.cache/pip
# Этап финального образа
FROM
pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
COPY
--from=build /opt/myenv /opt/myenv
...
...
@@ -40,4 +47,4 @@ RUN chown -R www-data:www-data /app && chmod -R 755 /app
EXPOSE
5000
CMD
["/opt/myenv/bin/python", "/app/api.py"]
\ No newline at end of file
CMD
["/opt/myenv/bin/python", "/app/api.py"]
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