使用 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


赞助商 我要投放

回帖
请输入回帖内容 ...