Commands used
curl -fSSL https://get.docker.com/ | sh
sudo systemctl enable docker.service
Sudo Systemctl Start Docker
curl -L “https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s) -$ (uname -m)” -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
mkdir LEMP
CD LEMP
mkdir logs
Touch logs/nginx-access.log
Touch logs/nginx-error.log
mkdir to MySQL
mkdir nginx
mkdir html
docker-compose up -d (learn what docker is and learn about docker commands here)docker-compose.yml file
nginx:
image: tutum/nginx
Ports:
– “80:80”
links:
– phpfpm
– MySQL
volumes:
-. /nginx/default:/etc/nginx/sites-available/default
-. /nginx/default:/etc/nginx/sites-enabled/default
– /Users/Uiraribeiro/Documents/LearnLinux/Public_HTML:/usr/share/nginx/html
phpfpm:
image: php:fpm
Ports:
– “9001:9000”
volumes:
– /Users/Uiraribeiro/Documents/LearnLinux/Public_HTML:/usr/share/nginx/html
links:
– MySQL
MySQL:
image: mariadb
Environment:
MYSQL_ROOT_PASSWORD: admin
volumes:
-. /mysql:/var/lib/mysql
phpmyadmin:
image: phpmyadmin/phpmyadmin
restart: always
links:
– MySQL
Ports:
– 8181:80
Environment:
MYSQL_USERNAME: admin
MYSQL_ROOT_PASSWORD: admin
PMA_ARBITRARY: 1
nginx/default file
server {
listen 80;
root /usr/share/nginx/html;
index index.php index.html index.html;
server_name 127.0.0.1; # CHANGE YOUR IP HERE
location/{
try_files $uri $uri/ /index.php $is_args$args;
}
location ~ .php$ {
fastcgi_split_path_info ^ (.+ .php) (/.+) $;
fastcgi_pass phpfpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
includes fastcgi_params;
}
}
Learn and develop your skills with the full Docker for DevOps course from the Linux Certification. You can enroll here with a free 7-day trial. If you already have an account, you can log in here.
Did you like it? Share 🙂
The sudo command on Linux executes a given command as if it were another user.…
The ss command on Linux is extremely useful for investigating sockets, providing various information about…
Free Linux command shows the amount of total memory in use and available, as well…
The shell has structures for testing conditions and executing certain program sequences several times (loop),…
The /etc/fstab file stores the configuration of which devices should be mounted and what is…
The Netcat Command in Linux or nc is a utility used to do “almost anything”…
This website uses cookies.