使用 docker 快速部署 solo

本贴最后更新于 1664 天前,其中的信息可能已经时移世改

前言

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


欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...