docker compose
Insha allah complete the following
1)upskill
docker compose
--
https://docs.docker.com/compose/gettingstarted/
---
docker compose
Dockerfile
docker-compose.yml
version: '3'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
- logvolume01:/var/log
links:
- redis
redis:
image: redis
volumes:
logvolume01: {}
docker compose commands for
Start, stop, and rebuild services
View the status of running services
Stream the log output of running services
Run a one-off command on a service
---
http://0.0.0.0:5000/
http://localhost:5000
--
docker-machine ip MACHINE_VM
http://MACHINE_VM_IP:5000
--
Hello World! I have been seen 1 times.
--
docker image ls
--
docker-compose down
---
The new volumes key mounts the project directory (current directory) on the host to /code inside the container, allowing you to modify the code on the fly, without having to rebuild the image.
---
docker-compose up
---
C:\Users (Windows)
---
docker-compose up -d
background running
docker-compose ps
-> to see what is currently running
--
docker-compose run web env
--
docker-compose --help
---
docker-compose stop
->you started Compose with docker-compose up -d, stop your services
--
docker-compose down --volumes
->You can bring everything down, removing the containers entirely, with the down command. Pass --volumes to also remove the data volume used by the Redis container
No comments:
Post a Comment