Volúmenes en docker-compose
Creación de volúmen
version: '3'
services:
web:
container_name: nginx1
ports:
- "8001:80"
volumes:
- "vol2:/usr/share/nginx/html"
image: nginx
volumes:
vol2:
Creación de volúmen tipo host
version: '3'
services:
web:
container_name: nginx2
ports:
- "8002:80"
volumes:
- "/var/www/html/mi_web_test:/usr/share/nginx/html"
image: nginx
Donde /var/www/html/mi_web_test
estaría mi página web html
Si eliminamos el container los datos persisten en /var/www/html/mi_web_test
ya que nginx
copia el contenido en su raíz del servidor html.
Last updated
Was this helpful?