电脑上确定安装有docker
1.将以下内容粘贴至创建docker-compose.yml文件内
version: '3.2'
services:
mysql:
image: mysql:8.0
container_name: opencart-mysql
hostname: opencart-mysql
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_DATABASE=opencart
- MYSQL_ROOT_PASSWORD=123456
restart: always
volumes:
- mysql_data:/var/lib/mysql
opencart:
image: aamservices/opencart:latest
container_name: opencart
hostname: opencart
restart: always
ports:
- '80:80'
- '443:443'
volumes:
- opencart_html:/var/www
depends_on:
- mysql
volumes:
mysql_data:
driver: local
opencart_html:
driver: local
2.运行docker-compose up -d
网友评论