Platform | Number of Instance | Reading Time |
---|---|---|
Play with Docker | 1 | 5 min |
- Create an account with DockerHub
- Open PWD Platform on your browser
- Click on Add New Instance on the left side of the screen to bring up Alpine OS instance on the right side
- Create a docker-compose.yml file
- Bringup the containers
- Stop the container of a single service
- Starting the stopped container
git clone https://github.com/collabnix/dockerlabs
cd dockerlabs/intermediate/workshop/DockerCompose/
cd wordpress
$ docker-compose up -d
$ docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------------
Mysqldb docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp, 33060/tcp
Nginx nginx -g daemon off; Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
$ docker-compose ps --services
webserver
dbserver
$ docker-compose stop webserver
Stopping Nginx ... done
$ docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------
Mysqldb docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp, 33060/tcp
Nginx nginx -g daemon off; Exit 0
$ docker-compose start webserver
Starting webserver ... done
NOTE: You cant directly bringup/Start containers using docker-compose start
.
Next >> Lab #12: Restart Command