Changes between Version 16 and Version 17 of dockerdeployment2023
- Timestamp:
- Dec 11, 2023, 10:48:10 AM (12 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
dockerdeployment2023
v16 v17 343 343 '''Key Concepts''' 344 344 345 Services: Each container started by Docker Compose is a service. Services are defined in the docker-compose.yml file.345 Services: Each container started by Docker Compose is a service. Services are defined in the compose.yaml file. 346 346 Networks: By default, Docker Compose sets up a single network for your application. Each container for a service joins the default network and is discoverable via a hostname identical to the container name. 347 347 Volumes: Volumes can be used to share files between the host and container or between containers. … … 349 349 '''Basic docker compose Commands''' 350 350 351 • ` docker compose up`: Starts up the services defined in the docker-compose.yml file.352 • ` docker compose down`: Stops and removes all the containers defined in the docker-compose.yml file.351 • ` docker compose up`: Starts up the services defined in the compose.yaml file. 352 • ` docker compose down`: Stops and removes all the containers defined in the compose.yaml file. 353 353 • ` docker compose ps`: Lists the services and their current state (running/stopped). 354 354 • `docker compose logs`: Shows the logs from the services. … … 357 357 358 358 Let's deploy a !WordPress application using two containers: one for !WordPress and another for the MySQL database. 359 Create a docker-compose.yml file:359 Create a compose.yaml file: 360 360 361 361 {{{ … … 394 394 }}} 395 395 396 '''Start the !WordPress and Database Containers:'''Navigate to the directory containing the ` docker-compose.yml` file and run:396 '''Start the !WordPress and Database Containers:'''Navigate to the directory containing the `compose.yaml` file and run: 397 397 398 398 `docker compose up -d`