Code Cookies Code Cookies

万物兴歇皆自然

目录
使用docker快速部署solo
/  

使用docker快速部署solo

前言

使用docker+docker-compose快速部署

Mysql

抛出13066端口,方便本地客户端连接

  shealtiel-mysql:
    container_name: shealtiel-mysql
    image: mysql:latest
    restart: always
    ports:
      - 13066:3306
    environment:
      MYSQL_ROOT_PASSWORD: root

Adminer

可选,是一个使用PHP开发的数据库管理工具

   adminer:
    image: adminer
    restart: always
    ports:
      - 13099:8080

solo

  shealtiel-solo:
    container_name: shealtiel-solo
    image: b3log/solo:latest
    restart: always
    links:
      - shealtiel-mysql:shealtiel-mysql
    environment:
      RUNTIME_DB: "MYSQL"
      JDBC_USERNAME: "root"
      JDBC_PASSWORD: "root"
      JDBC_DRIVER: "com.mysql.cj.jdbc.Driver"
      JDBC_URL: "jdbc:mysql://shealtiel-mysql:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC"
    command: --listen_port=4000 --server_scheme=http --server_host=localhost

Nginx

镜像 shealtiel/gateway:latest是作者自己的网关配置,发布到docker.hub上,目前配置了80端口,如果无特殊需求,可采用该镜像,也可以在服务器上单独安装nginx进行配置

  shealtiel-gateway:
    container_name: shealtiel-nginx
    image: shealtiel/gateway:latest
    restart: always
    ports:
      - 4000:80
      - 80:80
    links:
      - shealtiel-solo:solo

全部配置

version: "3"

services:
  adminer:
    image: adminer
    restart: always
    ports:
      - 13099:8080

  shealtiel-mysql:
    container_name: shealtiel-mysql
    image: mysql:latest
    restart: always
    ports:
      - 13066:3306
    environment:
      MYSQL_ROOT_PASSWORD: root

  shealtiel-solo:
    container_name: shealtiel-solo
    image: b3log/solo:latest
    restart: always
    links:
      - shealtiel-mysql:shealtiel-mysql
    environment:
      RUNTIME_DB: "MYSQL"
      JDBC_USERNAME: "root"
      JDBC_PASSWORD: "root"
      JDBC_DRIVER: "com.mysql.cj.jdbc.Driver"
      JDBC_URL: "jdbc:mysql://shealtiel-mysql:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC"
    command: --listen_port=4000 --server_scheme=http --server_host=localhost

  shealtiel-gateway:
    container_name: shealtiel-nginx
    image: shealtiel/gateway:latest
    restart: always
    ports:
      - 4000:80
      - 80:80
    links:
      - shealtiel-solo:solo



标题:使用docker快速部署solo
作者:shealtiel
地址:http://shealtiel.cn/articles/2020/06/03/1591114201625.html