-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Welcome to my repositories DevOps blogs
- Loading branch information
Nho Luong
authored and
Nho Luong
committed
Nov 8, 2024
0 parents
commit 76c4e49
Showing
101 changed files
with
6,961 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | ||
chmod +x /usr/local/bin/docker-compose | ||
docker-compose --version | ||
|
||
#docker-compose.yml | ||
version: '3.3' | ||
|
||
services: | ||
db: | ||
image: mysql:5.7 | ||
volumes: | ||
- db_data:/var/lib/mysql | ||
restart: always | ||
environment: | ||
MYSQL_ROOT_PASSWORD: somewordpress | ||
MYSQL_DATABASE: wordpress | ||
MYSQL_USER: wordpress | ||
MYSQL_PASSWORD: wordpress | ||
|
||
wordpress: | ||
depends_on: | ||
- db | ||
image: wordpress:latest | ||
ports: | ||
- "8000:80" | ||
restart: always | ||
environment: | ||
WORDPRESS_DB_HOST: db:3306 | ||
WORDPRESS_DB_USER: wordpress | ||
WORDPRESS_DB_PASSWORD: wordpress | ||
WORDPRESS_DB_NAME: wordpress | ||
volumes: | ||
db_data: {} | ||
|
||
|
||
docker-compose up -d | ||
docker container ls | ||
docker-compose scale db=3 | ||
docker container ls | ||
docker-compose down | ||
docker container ls | ||
cp docker-compose.yml stack.yml | ||
docker stack --help | ||
docker stack deploy -c stack.yml mystack | ||
docker stack ls | ||
docker stack services mystack | ||
docker service ps mystack_db | ||
docker service ps mystack_wordpress | ||
docker network ls | ||
docker stack ls | ||
docker stack rm mystack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#---1 Create a Play book to install apache server on the destination server with yum module install only if the OS is 'Redhat' or 'CentOS' and version 7 | ||
# Hint:- ansible_distribution is the variable which can have possible values 'RedHat','CentOS','Ubuntu','Debian' | ||
# ansible_distribution_version variable can have the value which can have the version of the linux | ||
|
||
|
||
#--2. Create a play book to install apache server on RedHat and Ubuntu server | ||
# Hint:- Create an Ubuntu machine and install python on it, apt module is used instead of yum in Ubuntu and name of software is apache2 not httpd | ||
|
||
#--3 . Create a play book to create testuser1 and testuser2 on all the hosts (use loop) | ||
Hint:- use "user" module | ||
|
Oops, something went wrong.