vim docker-compose.yml
代码语言:javascript复制version: "3.7"
services:
solo:
image: b3log/solo:latest
restart: always
container_name: solo
hostname: solo
privileged: false
depends_on:
- mysql
ports:
- 8080:8080
volumes:
- /etc/localtime:/etc/localtime
- solodata:/opt/solo/
environment:
- RUNTIME_DB=MYSQL
- JDBC_USERNAME=solo
- JDBC_PASSWORD=123456
- JDBC_DRIVER=com.mysql.cj.jdbc.Driver
- JDBC_URL=jdbc:mysql://mysql:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC
nginx:
image: nginx:1.17
restart: always
container_name: nginx
hostname: nginx
privileged: false
links:
- solo
depends_on:
- solo
ports:
- 80:80
- 443:443
volumes:
- /etc/localtime:/etc/localtime:ro
- nginxdata:/etc/nginx/
mysql:
image: mysql:5.7.29
restart: always
container_name: mysql
hostname: mysql
privileged: false
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: 123456
MYSQL_DATABASE: solo
MYSQL_USER: solo
MYSQL_PASSWORD: 123456
volumes:
- /etc/localtime:/etc/localtime:ro
volumes:
solodata:
nginxdata
docker-compose up -d