Skip to content

Commit 4ad4e45

Browse files
author
ClaraVnk
committed
Optimize Dockerfile build order and installation process
1 parent 33fa724 commit 4ad4e45

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM python:3.11-slim
44
# Métadonnées
55
LABEL maintainer="[email protected]"
66
LABEL description="OpenStack Metrics Collector - Prometheus Exporter"
7-
LABEL version="1.4.0"
7+
LABEL version="1.5.0"
88

99
# Variables d'environnement
1010
ENV PYTHONUNBUFFERED=1
@@ -18,15 +18,13 @@ RUN useradd -m -u 1000 -s /bin/bash openstack && \
1818
# Définir le répertoire de travail
1919
WORKDIR /app
2020

21-
# Copier les fichiers de dépendances
22-
COPY --chown=openstack:openstack pyproject.toml ./
21+
# Copier les fichiers nécessaires pour l'installation
22+
COPY --chown=openstack:openstack pyproject.toml README.md ./
23+
COPY --chown=openstack:openstack src/ ./src/
2324

24-
# Installer les dépendances
25+
# Installer le package et ses dépendances
2526
RUN pip install --no-cache-dir --upgrade pip && \
26-
pip install --no-cache-dir -e .
27-
28-
# Copier le code source
29-
COPY --chown=openstack:openstack src/ ./src/
27+
pip install --no-cache-dir .
3028

3129
# Changer vers l'utilisateur non-root
3230
USER openstack

0 commit comments

Comments
 (0)