informatica:linux:docker_compose
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
informatica:linux:docker_compose [2018/09/11 22:12] – jose | informatica:linux:docker_compose [2025/09/30 13:21] (current) – created jose | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Docker Compose | + | Para buscar |
- | ====== Ejemplo 1 ====== | + | docker |
- | Levanta un mysql y un nginx sin relación: | + | |
- | Creamos la carpeta test y dentro | + | |
- | docker-compose.yml | + | |
- | < | + | acfcef53029e |
- | version: | + | |
- | services: | + | |
- | | + | Buscamos el fichero: |
- | image: mysql | + | |
- | ports: | + | |
- | - "3306:3306" | + | |
- | environment: | + | |
- | | + | |
- | - MYSQL_USER=user | + | |
- | - MYSQL_PASSWORD=mypassword | + | |
- | - MYSQL_DATABASE=demo | + | |
- | web: | + | |
- | image: nginx | + | |
- | </ | + | " |
- | + | | |
- | Levantamos con el comando: | + | |
- | | + | |
- | Levanta los docker: | + | |
- | | + | |
- | test_web_1 | + | |
- | La red es 172.19.0.0. El puerto de mysql si que está expuesto en el host. El de nginx solo en el docker | + | |
+ | Vamos al directorio y lo paramos y borramos: | ||
+ | cd / | ||
+ | docker-compose down -v | ||
+ | [+] Running 1/2 | ||
+ | ✔ Container grafana_covid | ||
+ | ⠴ Container influxdb_covid | ||
informatica/linux/docker_compose.1536703968.txt.gz · Last modified: by jose