vault backup: 2025-03-05 18:10:50
This commit is contained in:
@@ -119,25 +119,49 @@ Docker rend programmable un tas de trucs
|
||||
|
||||
### Les engrenages
|
||||
|
||||
--
|
||||
---
|
||||
|
||||
### Fonctionnement général
|
||||
## Fonctionnement général
|
||||
|
||||
![[Pasted image 20250305175750.png]]
|
||||
|
||||
--
|
||||
---
|
||||
|
||||
### Images
|
||||
## Images
|
||||
|
||||
+ Représentation d'un OS déjà préparé
|
||||
+ Moyen principal de partage d'environnement
|
||||
+ Template pour les containers
|
||||
+ Container = instance d'image
|
||||
+ Organisée en layers
|
||||
+ Organisée en layers versionnables
|
||||
|
||||
--
|
||||
|
||||
![[Pasted image 20250305180252.png]]
|
||||
### Layers
|
||||
|
||||
![[Pasted image 20250305180252.png|768]]
|
||||
|
||||
--
|
||||
|
||||
### Créer son image
|
||||
|
||||
Avec un Dockerfile!
|
||||
|
||||
```Dockerfile
|
||||
FROM python:3.12
|
||||
WORKDIR /usr/local/app
|
||||
|
||||
# Install the application dependencies
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy in the source code
|
||||
COPY src ./src
|
||||
EXPOSE 5000
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user