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
22846c84
Commit
22846c84
authored
Dec 31, 2024
by
Artem Baranovskyi
Browse files
Image build is optimized.
parent
0868c4dc
Pipeline
#10604
failed with stage
in 1 minute and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
flask_ml_api/Dockerfile
View file @
22846c84
...
...
@@ -2,10 +2,10 @@
FROM
python:3.10-alpine
AS
builder
# Install system dependencies
RUN
ap
t-get update
&&
apt-get
install
-y
--no-install-recommends
\
build-
essential
\
python3-
ven
v
\
&&
rm
-rf
/var/lib/apt/lists/
*
RUN
ap
k add
--no-cache
\
build-
base
\
python3-
de
v
\
py3-virtualenv
# Create and activate virtual environment
RUN
python3
-m
venv /opt/myenv
...
...
@@ -32,11 +32,10 @@ RUN /opt/myenv/bin/pip install sentence_transformers && \
RUN
/opt/myenv/bin/pip
install
--upgrade
setuptools wheel
# Final image
FROM
python:3.10-
slim
FROM
python:3.10-
alpine
# Install system dependencies
RUN
apt-get update
&&
apt-get
install
-y
--no-install-recommends
\
&&
rm
-rf
/var/lib/apt/lists/
*
RUN
apk add
--no-cache
# Copy virtual environment and application from build stage
COPY
--from=builder /opt/myenv /opt/myenv
...
...
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