docker-compose
程序员文章站
2022-03-05 13:35:36
...
version: '3.9'
services:
mysql:
image: mysql:8.0.22
restart: always
ports:
- "3306:3306"
volumes:
- /my/own/data:/var/lib/mysql
- /my/own/config:/etc/mysql/conf.d
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_ROOT_HOST: '%'
redis:
image: 'redis:6.0.9'
restart: always
ports:
- "6379:6379"
volumes:
- /usr/local/docker/redis.conf:/etc/redis/redis.conf
- /usr/local/docker/data:/data
command:
redis-server /etc/redis/redis.conf --appendonly yes
下一篇: HTTP协议基础
推荐阅读
-
Docker-Compose的使用示例详解
-
docker-compose 详解及示例代码
-
Docker 私服Registry简介与使用Docker-Compose安装Registry
-
docker-compose一键部署redis一主二从三哨兵模式(含密码,数据持久化)
-
ASP.NET Core 3.0 : 二十八. 在Docker中的部署以及docker-compose的使用
-
一行命令安装docker和docker-compose(CentOS7)
-
Ubuntu15.10安装docker和docker-compose教程
-
Docker-compose的安装和设定详细步骤
-
docker-compose部署php项目实例详解
-
laradock环境docker-compose操作详解