### Redis+Mysql+Mongo
**镜像:**
```bash
docker pull redis:6.0
```
```bash
docker pull mysql:5.7
```
```bash
docker pull mongo:4.2
```
**容器:**
**Redis:**
```bash
docker run -d --name redis6 -p 6379:6379 --restart always redis:6.0
```
***
**Mysql:**
```bash
docker run --name mysql57 -e MYSQL_ROOT_PASSWORD=123456 -d -p 3306:3306 \
--restart always mysql:5.7
```
Mysql远程连接:(docker安装的mysql默认密码是123456)
登录到容器,登录到Mysql。
alter user 'root'@'%' identified with mysql\_native\_password by '123456';
flush privileges;
***
**Mongo:**
docker run --name mongo42 -d -p 27017:27017 --restart always mongo:4.2
###  Nginx + PHP-FPM
#### PHP-FPM
镜像
docker pull php:7.4-fpm
容器
docker run -d -v /www/wwwroot:/usr/share/nginx/html --name php7.4 php:7.4-fpm
#### Nginx:
docker run --name mynginx -v /www/wwwroot:/usr/share/nginx/html:ro -p 8080:80 --link php7.4:php7.4 -d nginx
登录到nginx容器:
docker exec -it mynginx bash
cd /etc/nginx/conf.d
mv default.conf default.conf.bak (default.conf占用了80端口)
apt update
apt install vim -y
vim /etc/nginx/conf.d/test.conf
切换粘贴模式:
set mouse-=a
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php$is_args$query_string;
}
location ~ \.php$ {
fastcgi_pass php7.4:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
include fastcgi_params;
}
}
**注意:**
由于Nginx与PHP-FPM不在同一台服务器,这里两个容器运行时指定的-v参数需要保持一致:
\-v /www/wwwroot:/usr/share/nginx/html
***
- 云平台介绍
- Docker介绍
- Docker架构
- Docker安装
- Docker命令实战
- Docker进阶实战
- 常用Docker容器构建
- Kubernetes简介
- Kubernetes架构
- kubeadm创建集群
- kubeadm引导集群
- Kubernetes资源
- Kubernetes-Deployment
- Kubernetes-Service
- Kubernetes-Ingress
- Kubernetes存储抽象
- Kubernets-PV&PVC
- Kubernetes-ConfigMap
- Kubernetes安装KubeSphere
- Linux单节点部署KubeSphere
- Linux多节点部署KubeSphere
- 中间件部署实战
- RuoYi-Cloud部署实战
- DevOps